Jump to content

NI-serial on RT target


Recommended Posts

Hi experts,

I am currently trying to work with an RS485 device connected to my sbRIO9627 RS485 port. The manufacturer developed a LabVIEW library to communicate with the device with a ModBus RTU protocol, requiring both NI-VISA and NI-Serial installed on the target. It worked fine at the beginning, then after a necessary format of the RT target, I am now not able to install the NI-serial drivers on the sbRIO as before, and the communication fails with a timeout error, but I still don't get any deploy or execution error.

The NI-serial drivers do not appear in the list of items I can install during the software installation on the target.

Does anyone have a clue about this? 

I am currently working with LabVIEW 2020, Linux RT image 21.0, NI-MAX 21.0f0, and I have to stick to LabVIEW 2020. 

 

Thanks in advance for your help

 

Link to comment

NI Serial is not required for the use of serial ports built-into the sbRIO-9627, only VISA. So that is not the problem.

I would try to simplify this down to a simple VI that initializes the port and tries to read or write to the port. Check if the initialization returns any errors and whether you get any data in or out of it (connect a PC with an RS485 uinetrface to the RS485 port and see). Note that if you are using 2-wire RS485 you will need to set the port in 2-wire mode for it to work...

(I would also stick to the 2020 RT RIO-install instead of the 2021 system image, but that's an unrelated story... )

Link to comment

Thanks a lot Mads for your reply. I already tried a very simple test with the built-in Modbus library: the initialization does not return any error, but every other attempt of communication (read or write) gives back a timeout error. I also tried to communicate with the device through the visa test panel on NI-Max, but I get the same error. The only way I can write is by using the 0 address, so broadcasting to any connected device on the bus. 

Do you know why it is not possible to install the ni-serial drivers to the RT targets anymore? I can only install the NI-serial 9870 and 9871 scan engine support. 

I agree with you about the system image version, I will roll back to the version 20. 

Thank you again

Link to comment

So you do have modbus communication, but the problem is that you *sometime* get a timeout? You are able to read/write data from the device, it just is not stable? If so the serial port seems to be working and all you probably need is to tune the timeout parameter or troubleshoot the device that replies slowly or not at all on some polls...What are the timeout parameters in this driver and their values?

I would connect a simulator instead to the port (ModSlave32 e.g. if the device is a slave,or ModScan 32 if it acts as a master...You can also run a trial of our Modbus Master that can be downloaded here: https://www.clampon.com/products/software/modbus-test-master/) that will let you view/ debug the communication (how often does it poll, do the poll commands look OK (can be verified in online verification tools e.g.) and does it timeout even if the simulator sent out a reply etc...). Using a simulator tool to verify that the connected device  replies as it should if connected to that is also a good thing to do.

(If that is not what you meant I would test this without involving Modbus or anything first. You can use a terminal program on the PC you connect to the serial port. We have one written in LabVIEW that simple to use, it can be downloaded here: 

https://software.clampon.com/ClampOn_Serial_Tool_CurrentVersion.zip

On the sbRIO you can run one of the serial IO examples that just initializes the port, writes something and reads...then check with the terminal program if you get what you wrote and read whatever you send from the terminal program. Once you have basic serial comms workingyou can go back to the modbus driver and see if that has any issues when the basic functionality is OK. If it does you take it from there..)

I've never had a need for NI Serial on any of our cRIOs or sbRIOs, only VISA and as you say the support for 9870/71 add-on...Perhaps they just list that driver as needed to cover the case where it is actually used with equipment that requires it? You could try to download the NI Serial driver separately, but normally NI Package Manager should present it as a possible option during software installation from NI Max, especially if you are using a system image.

 

 

Edited by Mads
Link to comment

Thanks again Mads for the prompt reply. The timeout error is always present, I cannot write or read anything to and from the device. I guess the problem is in the "read" part which is also included in the write command, which expects a reply from the device. The broadcast function (address 0) does not foresee any reply, as far as I know, and so the timeout error does not show up only in that single case. 

Everything works correctly with a PC, the problem only appears when connecting the device to the sbRIO. 

The NI serial drivers are present on the PC I am using, correctly downloaded from Package Manager by also including the installation of the RT drivers, but then NI-serial is not listed when installing the software on the sbRIO from NI MAX. I attached an image to show the behavior: I expect to see the NI-serial driver in the green box, but I only have the ni-serial 9870.... scan engine. This happens with both the online and offline installation (using the Linux RT offline installation support to access the local feeds). Is there a way to transfer the drivers manually in the sbRIO memory? 

 

Screenshot 2024-02-08 at 16.14.26.png

Link to comment
On 2/8/2024 at 9:46 AM, Mattia Fontana said:

I am currently working with LabVIEW 2020, Linux RT image 21.0, NI-MAX 21.0f0, and I have to stick to LabVIEW 2020. 

That's definitely a potential problem. If the RT image does not match the LabVIEW version, you usually can't even connect the project to it. What CompactRIO version have you installed?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.