Hello there,
Looking for a much bit of advise.
I am using the NI labview modbus library, RTU mode, using a USB to 485 converter. The library works fine as expected and performs all the read/write operations implemented in the library.
I am trying to design an application to control 20 slaves to perform a simple operation and read a register back from each slave, evaluate the value and to increment a counter if this value read is a '1'.
Now, the application needs to be automatic, sort of pressing "start" button and then to sequentially perform the writing to each slave, wait 5 mins to perform the operation, and then read the register of each one, update the counter..and back again.. continuously until you press "stop".
I started to shape the application with a flat sequence structure, with a first sub diagram containing the writing operation, and then wait 5 mins and so the second sub diagram would undertake the reading and update the counters.
1)First problem I have encountered is a very silly one, how to increment the value of the register to address the slaves sequentially in the first subdiagram in an effective way.
Any advise about how to do it?
I have tried a for loop (see attached) and use the iteration index to try to increase the address register but I struggle to covert the type of data..is there any easy way to do it, for instance ensuring I send two times the command to each slave?
Ideally I would to send command to slave #1 and then slave #2..etc.. but I am not sure how to do that.
2)How to stop the execution for 5 mins to let the slaves operate, and then carry out the reading?