PLCS.net - Interactive Q & A

PLCS.net - Interactive Q & A (http://www.plctalk.net/qanda/index.php)
-   LIVE PLC Questions And Answers (http://www.plctalk.net/qanda/forumdisplay.php?f=2)
-   -   3 Dimensional DINT and alarm values (http://www.plctalk.net/qanda/showthread.php?t=122958)

John Morris December 3rd, 2019 08:40 AM

3 Dimensional DINT and alarm values
 
1 Attachment(s)
Will the same trigger value in different dimensions create multiple alarms


Attachment 52789

Thank you for your time and attention

cwal61 December 3rd, 2019 10:49 AM

Looking at your Imagine it seems you have an array with a length of 3 not a 3 dimensional Tag. A 3D tag would be Tagname[n,n,n] an Array with a length of 3 is Tagname[0], Tagname[1] and Tagname[2]. The imagine shown of the alarms will not activate because you have the trigger at the bit level. (Tagname[n].x) The only value a bit can have is 1 or 0.

Now if you have set your trigger to the DINT tagname in the trigger tab and also selected trigger type as bits then the numbers in the trigger column would correspond to the bits in the DINT -1. Like the last one in your imagine. tagname[2].27 = 28th bit.

But your trigger only needs to be Tagname[2] The 28 in the next column is what infers Tagname[2].27

John Morris December 3rd, 2019 11:10 AM

3 Attachment(s)
I might not be thinking about this correctly. I assumed "Array Dimensions" and the selection of the "3" mean this array would have three dimensions

My question should have been

Would {Alarms_Motors(0).1} having a trigger value of 2
Conflict with {Alarm_Motors(1).1}having a trigger value of 2
Or are the separated by the dimension


Attachment 52791
Attachment 52792

Aabeck December 3rd, 2019 11:41 AM

Each DINT and BIT of an array is independent of all the others

The value of one DINT or status of one BIT will not have any effect of the rest of the array.

An array is just a nice way to group values together in a logical method.

John Morris December 3rd, 2019 11:43 AM

Thank you for the confirmation

cwal61 December 3rd, 2019 12:25 PM

2 Attachment(s)
Quote:

Originally Posted by John Morris (Post 833604)
My question should have been

Would {Alarms_Motors(0).1} having a trigger value of 2
Conflict with {Alarm_Motors(1).1}having a trigger value of 2
Or are the separated by the dimension

I see Aabeck answered your question but I wanted to make sure you understand that Alarms_Motors[0].1 will never have a value of 2 Just like Alarms_Motors[0].27 will never be equal to 28 only 1 or 0.

To use those values then your Trigger should be set up like this. Trigger Type should be set to Bit.
Attachment 52793

Your Message file would look like this.
Attachment 52794

If you use {[ShortCut]Alarm_Motors[0].1 then the trigger value will have to be 1 to show the alarm message not 2.

John Morris December 3rd, 2019 01:32 PM

I appreciate the clarification

Thank you

ASF December 3rd, 2019 04:33 PM

Just to clarify - this is not a three-dimensional array. It's a one-dimensional array with three elements. Which, as others have already clarified for you - are completely independent entities.

A one dimensional array might be called "Array_1D" and have a data type of DINT[4]. This then gives you four DINT's - Array_1D[0] through Array_1D[3]. You might represent it like this:
Code:

Array_1D[0]  Array_1D[1]  Array_1D[2]  Array_1D[3]
A two dimensional array might be called "Array_2D" and have a data type of DINT[4,3]. This then gives you a "grid" of 12 DINT's - Array_2D[0,0] through Array_2D[3,2]. You might represent it like this:
Code:

Array_2D[0,0]  Array_2D[1,0]  Array_2D[2,0]  Array_2D[3,0]
Array_2D[0,1]  Array_2D[1,1]  Array_2D[2,1]  Array_2D[3,1]
Array_2D[0,2]  Array_2D[1,2]  Array_2D[2,2]  Array_2D[3,2]

A three dimensional array might be called "Array_3D" and have a data type of DINT[4,3,5]. This would give you a total of 4x3x5=60 DINT's - Array_3D[0,0,0] through Array_3D[3,2,4]. I'm not going to attempt to ASCII-art that one :D

John Morris December 3rd, 2019 04:54 PM

Understood ASF, I appreciate your explanation.

FYI, be closer to your neck of the woods in the near future, have a start up of a new facility in New Zealand first quarter next year.

ASF December 3rd, 2019 05:04 PM

Ah, Kiwiland is nice that time of year. You really should pop your head in next door while you're here, it's only a three hour flight!


All times are GMT -4. The time now is 10:36 AM.

.