03-14-2019 11:42 AM
Hello everyone,
I am trying to acquire flow rate data from a sensor via the serial port of my cRIO in Labview.
I am using:
I read several posts online and I am trying to use a I/O server to do so (http://zone.ni.com/reference/en-XX/help/370622M-01/lvmve/create_mb_ioserv/)
I can see the RS 485 port as 2-wire connection on NIMAX, I added the modbus serial I/O server (master) from the RT target in my project and I created the bound variable of interest (flow_data) in my "IO variables" library.
However, when i open the properties of my I/O server I can only pick the serial port in the range COM1 to COM32, which doesn't correspond with the name of my cRIO port I see on NIMAX.
How do I know which one is the correct port?
In my vi I only have the shared variable connected to an indicator.
When I try to run it using one COM port (which I am not sure is the correct one) I get the following error:
-1967353900
Shared Variable in Platform_master.vi<APPEND>
This error or warning occurred while reading the following Shared Variable:
\\.\IO_Variables\Flow_Data
\\.\IO_Variables\Flow_Data
I would really appreciate any suggestion to do so and solve my errors.
Thank you very much.
Gaia
03-19-2019 10:42 AM
Hey Gaia,
I'll start by saying I'm not too familiar with MODBUS, but I imagine one way to get the COM address of the serial port would be to connect to your cRIO over ssh and list the contents of the /dev/ folder. This should have an entry for the built in serial port.
Can I ask whether you can post your project, or screenshots of it, as this may help troubleshoot this?
Cheers!
Mitch
03-20-2019 08:39 AM
Hello Mitch,
thank you for your reply.
I attached four screen shots:
1 - NIMAX interface were I can see my cRIO serial ports and their names. the RS 485 is the one I named COM1
2 - My project master. Under IO_variables I have my server I/O "Modbus1" and its bounded variables. I am interested to read a sign integer (input register S300001 or holding register S400001). Here you can also see how I call the variable on my vi (red circle).
with this vi I now get error -1967353902
3 - Screenshot of the properties of my I/O server (you can see that the serial port is COM 1 but as a choice I have COM1-32 and I don't see the visa original name of the cRIO serial port)
4 - As an alternative to the I/O server, I tried to use the modbus library (Flowmeter test 2 vi attached)) . Here I am sure I am using teh correct port because I see its original name. This way I get error 56.
I hope this helps.
Please let me know if you have any suggestion.
Best,
Gaia