11-02-2016 01:30 PM
I am trying to interface an NI cRIO with an Alycat Mass Flow Control, using Modbus RTU, with the cRIO as the master and the Alicat as the slave. I am able to read registers easy enough (16-bit and 32-bit) however, I am not able to write to any registers. For example: the Alicat Register for writing a value to a gas is #400046. I am able to write to that address from my RedLion HMI, so I am certain it is correct. The Alicat Modbus Manual says it uses "16-bit inter value 40046". Then, I create a Text Ring in the LV and then edit the values so that 0=Air, 1=Argon................etc.. . I am not super experienced with LabVIEW so I am not sure what my next step is. I tried using different data types and word sizes but nothing is working. So, I am using a UINT16. My Modbus settings are over serial (2-wire), mode is RTU, and I have the "Use function code 16 for single write" enabled but it doesn't appear to be working. Would anyone have an idea as to why this is happening? Thank you much for your time.
Sorry about the duplicate, I placed this in the wrong topic at first.
11-03-2016 03:49 PM
Hi ceilingwalker,
Are you using the Modbus VIs that came with the LabVIEW Real-Time module? If you haven't already, it could be helpful if you explore the "Modbus Library.lvproj" shipping example to see how it codes for a master on an RT target.
Could you post your code or a screenshot to help us see where you're at?
Lauren D
Applications Engineer
National Instruments
11-04-2016 11:15 AM
Greetings and thank you for your reply. I am attaching my project however, I am not sure if I saved it properly or not. I don't have internet access on my laptop with the LV running on it.
11-04-2016 11:15 AM
Greetings and thank you for your reply. I am attaching my project however, I am not sure if I saved it properly or not. I don't have internet access on my laptop with the LV running on it.
11-07-2016 09:43 AM
When I extracted the files, I was only able to open the project. It looks like the .lvlib files and the VI were not attached, could you attach those? Creating a zip of all of the files would probably be easiest.
-Lauren
11-07-2016 10:28 AM
ceilingwalker,
Typically function code 06 is used for a single register write, not function code 16. Perhaps your Mass Flow Controller doesn't support function code 16.
-DR2