Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to talk to different serial ports simultaneously?

I need to be able to read from/write to four different serial ports simultaniously.

I'm trying to make a subvi called Tip.vi that handles all the actual writing, reading and parsing of data from a single port. I want to use 4 (instances/copies/whatever) of Tip.vi within a Main.vi.

Main.vi deals with user interactions, data gathering etc. Tip.vi has a string that get's updated with whatever bytes are currently available at the port. I want to keep this string within Tip.vi, not have to pass this to/from Main.vi.

I had all this working great with just one Tip.vi. When I added a second Tip.vi bad things happend.

  1. if two copies of the same code, named differently, was used, one Tip.vi seemed to keep the second Tip.vi from running enough.

  2. if just the subvi Tip.vi is made reentrent the strings from different ports would get jumbled together, not stay seperate.

  3. if the code Tip.vi and all of it's subvi's reentrent still the strings would get jumbled.

  4. I tried making a template out of Tip.vi (so it's Tip.vit) but it wouldn't instantiate in Main.vi



I recognize that the VISA Read used in every Tip.vi will all happen serially, I can't figure out how to make VISA Read reentrenet.

I give up. How can I read/write to two ports simultaniously. Some sample code would be great.

Thanks very much for the help-
Ariel
0 Kudos
Message 1 of 2
(2,777 Views)
Hello,

Check the other post; I posted a response there 🙂

Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 2 of 2
(2,759 Views)