LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manage serial VISA interrupts

Hi to all

I have a "4 RS 232 multiport PCI board" and I´m using VISA serial read function to read from all the ports. The devices which I´m communicating are too slow, so the read operation of all the comm ports takes about 2 second and during this time the VI can´t do any task until the read operation ends.
I´d like to know, if it´s possible to manage serial interrupts by VISA events, since each port have an IRQ provide by the system bios.
Anyone can help me??

Thanks in advance

Victor
0 Kudos
Message 1 of 5
(3,308 Views)
Heres a suggestion

Scan the property nodes for the serial ports that indicate if there is data available (put a small pause in if you intend to use other VI's in parallel)

It's a bad idea to try to manange the interrupts yourself, as it probably uses shared interrupts anyway for 4 ports and the code would not scale too more ports readily.

Comments please....
0 Kudos
Message 2 of 5
(3,284 Views)
Hello,

that's right, the easiest way would be to check the VISA property Bytes at Serial Port periodically (leaving time for other things to execute), and then call VISA Read when you are sure there's info to be read.

Another approach, probably more sophisticated, is to use VISA Events. In this case, you would use the VI_EVENT_ASRL_CHAR event type to trigger the code you wish to run when data arrives at your port (normally, reading it!).

I think you'll be able to find an example of this if you search a little bit.

Regards,

Jorge M.
0 Kudos
Message 3 of 5
(3,266 Views)
I have a question about using the VISA events:

If i'm using hardware handshaking, and my pc signals that it is ready to receive data (DTR is raised) will my device start to send characters as soon as DTR is raised, or will it hold off until the visa read function is encountered? (ie: if the visa event is in a while loop, and labview is finishing executing some other code, will my device somehow know to wait before it sends the data, or will it send it right away?)

Thanks.
0 Kudos
Message 4 of 5
(3,222 Views)
I think I just realized the answer to my question.

The "VISA configuration serial port" function will raise the DTR and then when I close the port using "VISA close" the DTR will be lowered, so I won't miss any data.

Is this correct?

Thanks!
0 Kudos
Message 5 of 5
(3,220 Views)