Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

help needed with Visa problem complicated with a cRio 9474

Summary:  Interruption of a data packet from a Visa serial port with repeatable actions when using a cRio 9474.

 

Environment:  NI-PXI-8190 Pentium 4 2.0 Ghz system 512MB RAM, Windows XP Pro

SP2, Labview 8.0. 

 

PXI-7811R with cRio units: 3-9263’s; 9221; 9401; 9474; 9435; 9215.

2630 multiplexor, and an 8421-RS485.

Visa 3.4.1;

NI Switch 3.00.49161;

NI-Serial 1.8.1;

NI-DMM 2.5.0

 


This is to become a test rig for a small aircraft embedded engine control system.  The control system produces a multi-channel data stream to a RS 232 serial port.  We are reading this using Visa Configure and Visa Reads.  As we are continuously reading the data stream, we are sending signals to the control system through the cRio devices to simulate the temperatures, pressures and speed (Rpms) of the engine.  We are using the 9474 to simulate the engine speed, and when the external power supply to the 9474 is started, the data stream being read is interrupted (instead of 78 bytes packet read, only 24 are placed into the Visa read buffer).

 

The property node (Bytes at Port) shows 78 bytes, the Read asks for a byte count of 78, but the return count is only 24.  We have narrowed this anomaly down to when the speed signal is powered through the 9474 – that is, the data stream is complete and correct, until this happens. 

 

We suspected the control system was sending bad data, but we placed a separate computer running a DOS character monitor on the RS 232 data stream and is it complete and correct, Showing us that the full 78 bytes are being transferred, but the Visa read is only producing the 24 bytes. 

 

Then we tried another computer running a small VI that simply reads the RS 232 data stream with Visa (its actually the same sub-Vi doing the reading, but in a smaller easier to handle main VI).  The data stream was interrupted on this computer as well!  Let me repeat this:

  1. Started the engine simulation without the speed signal.
  2. Read the RS-232 data stream with Visa (everything okay).
  3. Removed the RS-232 cord from the main PXI system and attached it to the separate computer (the data is still streaming, complete and correct coming from the control system).
  4. Start the speed signal external power to the 9474.
  5. The data stream gets cut off at 24 bytes on the separate computer running the Labview 8.0 VI with Visa 3.4.1
  6. Remove the data cable and attach it to a third computer running a character based data monitor and see that the data stream is complete (78 bytes) and correct.

 

Since the DOS monitor reads the full stream, and both the main computer running Visa 3.4.1 and the separate computer running Visa 3.4.1 only pass on 24 bytes, something seems to be going wrong in the Visa/serial driver.

 

Any ideas?

Tony

I’ve attached the sub-Vi that reads the packet and the FPGA.VI that drives the 9474 engine speed signal.

 

The rs-232 data stream is continuous and must be sync’d using 4 sync bytes hex ‘FEFEFEFE’ – then the 78 packet bytes are read.

 

The engine speed section of the Fpga.vi is the second loop.


0 Kudos
Message 1 of 2
(3,221 Views)
 

Hi clearman,

This is definitely odd behavior.  First I would make sure you have the latest version 3.5 of NI-VISA installed.  You also said that you are using a PXI-8421 which is RS-485, but you mention that the control system is using a RS-232 port.  Keep in mind that the two are not interchangeable.  Are you using the PXI-8421,or the built-in RS-232 port on the PXI controller?

Another suggestion would be to try to replace any asynchronous VISA reads with synchrounous VISA reads.  This will help assure that the VISA Read is completing before any other code is executed.

If none of these options fixes the problem, please post a NI-Spy log.  This will allow us to see exactly what the driver calls and serial bus are doing.

0 Kudos
Message 2 of 2
(3,201 Views)