
Tarasik (Customer) asked a question.
Hello everyone, I have built a graph on my PC based on two values from the AI of the BRX controller. The communication between the BRX and my PC is established through Modbus, and the pool rate is 10Hz. I'm satisfied with the results so far, but now I need to increase the speed of obtaining values by ten times. This means that I need the time between points on my graph to be 10mS instead of the current 100mS. To accomplish this, I intend to transfer two arrays, each containing 10 input values, from the BRX to the PC. The idea is to increment the index and update the MHR registers with the latest values every 10mS. I'm familiar with how to do this in LabVIEW or "C" language, but I'm not sure how to do it in the controller. Can anyone provide me with some examples of how to work with arrays? Maybe I am asking for too much from the BRX controller, but I would appreciate any guidance or advice. Thank you
Array indexes are V memory locations, so say you use V42 as your array index, MHR[V42] would reference the MHR location of the value in V42. So if V42 equaled 99, then MHR[V42] would be MHR99, or Modbus Holding Register 40099.
Have V42 start at 1 (so Holding Register 40001) and go to 10 (40010) (or whatever range you think you need)
Have an auto-resetting 10ms TMR that increments V42 every time it is .Done and copies the AI value into MHR[V42]. When V42 goes to 11, set it to 1.
Not sure how you synchronize the Master polling - you will lose or duplicate entries. Possibly have 2 buffers that you pingpong between, with a MI that you toggle every time one of the buffers is "done". Then your PC just monitors that Modbus Input bit, and when it changes, read the buffer related to its state (e.g. MI1 equal to OFF means 40001 thru 40010 is done, ON means 40011 thru 40020 is done). It complicates the logic a little bit on both ends. You may have already thought this out, so just ignore this if you know you're ok.
If you don't need to monitor "real time", look at FILELOG with the RAMDRIVE file system - it can probably keep up with logging every 10ms in "bulk". You probably would want to pingpong 2 files for the same reason you need to pingpong 2 arrays.