LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ER5000 Connection to cRIO

Hello all,

 

I am fairly new to LabVIEW and I wish to connect a Tescom ER5000 pressure regulator to my cRIO-9082. The regulator comes with a USB (Type A) cable for communication. I am using the vendor supplied USB-RS485 converter to connect it to the RS-485 port on the cRIO, but this has proven unsuccessful. The vendor also supplies LabVIEW sample code that I am using to test the connection. I cannot tell if the cRIO recognizes if anything is connected to the RS-485 port. I connected the regulator to my PC and it works there with no problems, but I need to connect it to cRIO. Is it possible to use the USB ports on the cRIO to communicate with the regulator? I've tried using VISA suite but have had no luck there. Any help would be greatly appreciated!

Download All
0 Kudos
Message 1 of 11
(3,512 Views)

This driver uses a DLL. DLLs are Windows binary shared library modules. Your cRIO does not run Windows but depending on the model either NI Linux RT or another realtime OS. So that DLL can never work on the cRIO.

 

But reading the manual shows some interesting details. Frist, the device has directly a RS-485 connection that should be possible to be connected to the cRIO RS-485 port. RS-485 is a bit tricky and you also should not forget to use termination resistors. Then you have the problem about baudrate and such settings.

 

Further has the manual quite a bit to say about software. It goes into some details about the ERTune software which is a Windows program and about the USB driver installation. It does not mention what type of USB controller they use, however it seems to provide a USB-COMM device class, so if you know the type of USB controller used, there is actually a possibility that an according Linux driver might be available and then the interface would be usable as a simple serial port on the cRIO. But that is quite a bit of low level Linux trouble. Further reading in the download it seems that they register the USB port as a standard USB CDC (Communication Device Class) device but they use a custom VendorID 0x27ED for Tescom-Emerson Process Management and a Manufacturer ID 0x0001. So the standard Linux driver would work but Linux does not know that this VID/PID combination is a virtual serial port. Getting Linux to recognize that is something I haven't done, although I'm sure it is not much more than some configuration text file somewhere with two or three lines of text, for someone who knows this.

 

Are you scared by a command line? If not this is a starting point after you logged into the cRIO controller through putty or WinSSHTerm: https://www.ccsinfo.com/faq.php?page=linux_cdc

 

The manual does however mention that the installed Windows software also comes with the program source code (probably in C) which would be very interesting to use for understanding what the actual protocol is. With that it would be pretty straightforward to write directly in LabVIEW to the VISA port once the device is connected to the cRIO either over RS-485 or the USB port and an according Linux serial device driver has been installed. Unfortunately the Emerson website does provide a link to a software download, but that link is dead. But I found an alternative link that gave the download anyhow.

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 11
(3,484 Views)

I have never worked with a cRIO system but I have used Tescoms quite a bit. We usually tune them using the supplied program, then I control them through LabVIEW using analog outputs.

0 Kudos
Message 3 of 11
(3,433 Views)

Thanks for the reply, Rolf

 

My cRIO has Phar Lap ETS as the OS, so I am not sure if your recommendations for Linux would work. Not sure how to go about installing serial drivers on my PharLap machine. I ran a DLL Checker and it showed two missing functions as dependencies. I'm looking at how to get that issue solved, so I await your reply 

 

The software also has a document showing the communication protocol used by the regulator in conjunction with the source code. Is it possible to recompile it for the cRIO?

0 Kudos
Message 4 of 11
(3,400 Views)

@Oshmoe

 

You are right aobut the cRIO 908x series using Pharlap.  My best recommendation is look for the dependencies on a Windows machine.  So get it working on Windows then compare the depencdency files to that of the Pharlap cRIO and tyr and plug and replace the dependent files.  That would be a quick and dirty try at a fix.  There may be something lower level though that you may have to figure out if it's registry key dependent (not a lot of experience with registries on Pharlap).  

Regards,

Ben Johnson
ʕง•ᴥ•ʔง
0 Kudos
Message 5 of 11
(3,391 Views)

Ahhh, no! Phar Lap ETS won't be able to recognize your USB Virtual Comm Port at all. I wasn't aware that your controller is a cRIO-908x model. Did you mention that anywhere?

 

The only real option will be to use directly the RS-485 connection. As mentioned, Emerson delivers their software with the C source code for their application and driver DLL. I had a quick look at the driver and the protocol is binary but fairly simple. The commands are usually about 4 bytes and then there is normally some similar response.

 

Implementing this directly in LabVIEW on top of NI-VISA calls would be fairly easy once you have the device connected to the COM2 port of your cRIO. Or you get a NI Linux cRIO instead.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 11
(3,381 Views)

Thanks, teritask! I was trying to have the tuning and control both done in LabVIEW through the cRIO. 

0 Kudos
Message 7 of 11
(3,346 Views)

Rolf,

 

I did some digging and came across a forum post (in which you also contributed) from a few years back regarding DLLs and PharLap. I ran a checker that showed the Emerson DLL is incompatible with my RT system. From what I understand, I may have to recompile the source code to be compatible with PharLap (which might also be a very time consuming process). 

 

I will try to implement the protocol directly in LabVIEW and post results. 

0 Kudos
Message 8 of 11
(3,324 Views)

Have you been able to directly connect the RS-485 interface to the cRIO, Without that it won't work for you since there is simply no way to get the USB to RS-485 converter that comes with your device to run on Phar Lap ETS. That also means that the DLL as is won't likely work either even if you got it compiled for Phar Lap ETS.

 

Basically there are only a few ways to get a DLL compiled for running in LabVIEW Phar Lap ETS and they require very specific versions of Visual Studio to work. Anything later than Visual Studio 2010 will create a DLL that can never run on on the Phar Lap ETS system.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 9 of 11
(3,314 Views)

I have connected the RS-485 to the cRIO, but it doesn't recognize it. I suppose I will have to abandon this idea.

0 Kudos
Message 10 of 11
(3,241 Views)