(0)| 12/27/2023 6:05 AM | |
|
Joined: 1/21/2013 Last visit: 12/29/2025 Posts: 4367 Rating:
|
Hi HDPelektrix, Using an IF statement would not be a good way because it requires an ELSE statement to reset the output. A simple assignment like
would suffice. Of course, this has to be done 120 times. If your output addresses are configured so that the address can be calculated using only the index, using the "Write memory bit" instruction would be an option. This will reduce your coding effort, but I expect a higher CPU runtime compared to using the assignment instruction 120 times. Kind regards |
This contribution was helpful to
|
|
| 12/27/2023 6:52 AM | |
|
Joined: 2/9/2021 Last visit: 7/9/2025 Posts: 8 Rating:
|
Hi Stefan Indeed this would take a lot off effort to type and would look like amateur coding :) Thanks for the answer. i saw POKE_BOOL passing by but my knowledge needs improving. still will dig in to it. Just saw this post on the forum that uses an array of ouputs in the tag table, will give this a try as well Here they suggest making an array in the tags (in my case of bool) with start adress Q0.0 In my logic i could move the On/Off bit from the machinesDB to an "passtrough array" of bool after the logic loop is finished i move the "passtrough array" to the "tagtable array" Any thoughts? Thank you! |
|
Understanding Tia BIT by BIT... |
|
| 12/27/2023 7:19 AM | |
|
Joined: 1/21/2013 Last visit: 12/29/2025 Posts: 4367 Rating:
|
Hi HDPelektrix, Using a PLC data type (UDT) to access the outputs would be an option I also had in mind when I posted my previous answer. However, you must remember that the memory area must not be overlapped by another tag and must be defined without gaps. Depending on your hardware, you may not be able to configure the I/O addresses that way. But if you are able to configure it that way, this might be a possible solution. Kind regards |
Follow us on