From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel Comunication to GPIB instrument

Hi

 

We have a GPIB instrument (Agilent 33210A Function Generator) and we want communicate from 2 parallels process in the same vi, (2 parallel loops). In labview 2012

 

We try to use the "GPIB status" function to check when instrument is in listen mode. (We check the LACS bit to determine when the instrument is in listener mode)

 

In my program we have  a principal loop and a secondary loop. The principal writes different frequency data to the instrument and the secondary loop try to write a frequency when the instruments is "free".  Sometimes it's works and sometimes it doesn't work.

 

How is posibble to make it? Do anybody in here knows a smart way to do it?

 

Thanks you very much!

Download All
0 Kudos
Message 1 of 6
(4,602 Views)

Make a third loop that does nothing but communicate with your instrument.  You can use a queue to send messages to that loop to request whatever action you need.  This will prevent your two parallel processes from interrupting each other.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(4,595 Views)

Thanks you for the answer!

But It's not possible a third loop. The file that I attachment it's only a test. Actually we can't modify the principal loop. We only can create a second parallel loop that check the status of the communication with the instrument. Our goal is that our process write and read data to  the Function Generator when it is free

Thanks

0 Kudos
Message 3 of 6
(4,575 Views)
Use a VISA lock. Checking for listen mode seems like a fragile hack.
0 Kudos
Message 4 of 6
(4,573 Views)

Sounds like a hack 😉

 

Do you have access to the main code? 

 

All it would need it is to replace the visa write vis used  to communicate with your generator with your own sub vi which is not reentrant and handle the looking.  

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 6
(4,563 Views)

Ha Ha Ha!  Don't worry! Everything is legally

Yes, I have access to the main code, but it's being developed by other group. My work try to add a parallel process to check the instrument status.

You give me a good idea man, thanks you!. And also thanks to Dennis.

You'll be hearing from me, soon. hopefully it will work

 

Greetings from Spain (Valencia)

 

0 Kudos
Message 6 of 6
(4,559 Views)