LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel RS-232 Reads

I'm using a cRIO 9074 with LabView 8.6.  I have a host VI that processes data and acts as an interface so it has a few parallel while loops.  A few of the devices that I'm reading from (over the NI 9870 RS-232 module) send unsolicited messages, so I have a few serial reads set in loops.  When I try to time the loops using Waits, they miss a lot of data.  When I don't it prevents the rest of my program from running.

 

Is there a way to have the serial reads wait until they receive data?  I'm using essentially the stock 9870 Interrupt code modified for 8 ports, and have attached the VI's to this post.  If I left out any information or am missing anything, just let me know.  Thanks for any help or insight you can provide...

 

-Bryan

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

Hello bguy,

 

What u can do is to let the data from the NI 9870 be stored in registers or collector in an event structure. A case structure shall run the program when there is no data from the NI 9870. When data arrives from the devices the event structure should switch the nested case structure to cater for the serial data collected. U can time the event structure aswell. in which case the data collected over the period of time can be poured into the original VI after regular interval. In any case the event structure and a nested case structure will prevent data from getting lost and from interrupts in the run cycle. U'll have to be a brainiac in programming the event structure as when i faced a similar problem i remeber it took me some good time programming it.

 

Regards.

Regards
Asad Tirmizi
Design Engineer
Institute of Avionics and Aeronautics

" Its never too late to be, what u want to be"
Using LabVIEW 8.2
0 Kudos
Message 2 of 3
(2,613 Views)

Hey,

 

Thanks for the advice.  Do you (or does anybody else) happen to have any examples of how to implement this?  The concept makes sense,  but I'm not positive on how to actually program it...

 

Thanks,

Bryan

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