LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time Target Limitations

I have a real time target that I am using as part of a hardware in the loop simulation.  The target is simply a desktop PC.  It only has one PCI card slot which is currently being used by a DAQ card to communicate with external hardware.  I have a sensor that needs to communicate with this real time target.  The sensor is capable of sending data through a CAN connection and through a serial connection.  Since the one PCI slot in the machine is already being used, I cannot use the CAN connection (this is the method I have used in the past to communicate with the sensor).  I was wondering if the Labview Real Time OS supports communication through a serial port, since the desktop has a serial port integrated into it's motherboard.  Are there any examples of this that I could look at to get me started?

 

-Eric

0 Kudos
Message 1 of 2
(2,504 Views)
EricHettler-

You can definitely use the Serial port on your RTPC however it is not recommended.  This is because instrument communication because communicating with GPIB, serial, or other instruments is inherently non-deterministic.  If this is not a concern then use the serial ports at your discretion.  You can gain access to the COM ports by using the NI-VISA driver.  Just as you would with your development machine, you would set up your RT code in the same way.  Simply call the COM port you wish to use and setup the VISA API the same.  You will not need to do anything special since you will be deploying this code to your RTPC (ie. just pass “COM 1” for your “VISA Reference Name”).  This is due to the fact that when this code is deployed, “COM 1” will inherently reference the COM port of the computer it is running on.

For an example for working with VISA and your serial port, take a look at the NI Example Finder.  Then look in Hardware Input and Output>>Serial>>Basic Serial Write and Read.vi.  The setup will be the same for your code.
Regards,

Mike S
NI AE
0 Kudos
Message 2 of 2
(2,479 Views)