Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

two apllication communicate with a GPIB device

Hi,
an application is running in background communicate with the Maschine, sends and recieves his own Data. My Application should send also his commands to contol the Maschine. It comes somethimes to crash. As an application waits to recieve Data from the Machine and the other application send Data to the Machine. I uses ThreadIbasta to check the current state before i send a command. But with the one and same 'Ibsta' value (and no error) once i get error once not. 
If i stop the backrground application everything works properly with my application, but the background application mus run too.In one sentense, how can i findout the right time to send a command to a GPIB device while other application is communicate with the same device?
Thanks

 

 

 

 

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

In general, a single resource should never be used by multiple applications.  If possible, I would see if you can send a message via TCP or some other way to the "background appliction" to have it send the commands you want and pass back the data.

 

Another option is to simply rewrite what the background application is doing in your application and then have a single loop that can recieve messages and send them for you.  That single loop is the only location you should be doing the communications with the instrument.


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 3
(2,784 Views)

The easiest one, if you are running in the development environment, is to add a vi that handles commands.

So not longer directly communicate with the machine, but send the question to a subvi and wait until you receive the answer. So all communication is handled by the subvi.

If taking data is slow you need three things: a command, a status and a reply.

The command only replies with, I understand the command.

The status answers data available or not.

The reply gives you the data in the correct format.

Inside the subvi you can queue commands from several clients and answer each appropriate while handling just one sequence with the machine.

greetings from the Netherlands
0 Kudos
Message 3 of 3
(2,783 Views)