Instrument Control (GPIB, Serial, VISA, IVI)

annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

Using driver in Parallel Loop

Risolto!
Vai alla soluzione

In my VI, I have two parallel loops communicating to the same DC supply through RS485.  The 1st loop will issue command to read the set pont of the DC supply, and the 2nd loop will issue command to set the set point of the DC supply.  There is a potential that they will try to commmunication with the DC supply at the same time.  If so, would there be a conflict?  Or would LabVIEW and VISA be able to handle something like that?  If there is a conflict, I was thinking about using a semiphore.  Any other ideas?  

 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Messaggio 1 di 13
4.871Visualizzazioni

Statemachine with Initialize, read, wait, write, wait, Stop commands looks good to me. I use semaphores when there is a potential of race condition happening on queues.

Messaggio 2 di 13
4.867Visualizzazioni
Soluzione
Accettato da autore argomento jyang72211

A very simple functional global that handles all the communication with your supply handles this.

A functional glabal can only execute one command at a time and LabVIEW by default schedules the command from the other while after the first command.

functional globals are also called action engines and these mad life in LabVIEW possible before we had objects.

greetings from the Netherlands
Messaggio 3 di 13
4.863Visualizzazioni

FG is what I am going to do.  Thanks!

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Messaggio 4 di 13
4.859Visualizzazioni

Actually, I changed my mind.  I ended up using a semaphore instead.  As I started to build my action engine, I realized that I had way too many functions that I need to implement.  Semaphore is much simpler for my context.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Messaggio 5 di 13
4.853Visualizzazioni

Hi

Did you search for a driver for your power supply on instrumentdriver.net

http://www.ni.com/devzone/idnet/

greetings from the Netherlands
0 Kudos
Messaggio 6 di 13
4.843Visualizzazioni

A driver doesn't exist for my instrument.  However, I have coded all the driver functions that I need.  To use the AE approach, I need put all the 10 functions that i coded into the AE (5 functions for the 1st loop and 5 for the 2nd loop).  Each function has its own inputs and outputs, so it is a lot work for a one time deal.  Making the AE is not hard, but it is a little bit too much work compared to the semaphore approach.  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Messaggio 7 di 13
4.836Visualizzazioni

I understand your problem.

greetings from the Netherlands
0 Kudos
Messaggio 8 di 13
4.833Visualizzazioni
I'm late here and I see you got it working which is good. But it should not be necessary to implement all the functions in an AE. You just need one with initialize, write, read and close. Your other VIs will create commands and parse results. I do something similar with an additional function - "ask". That function sends a command and returns the result. I know you said that you are writing in one loop and reading in the other. But the point is that the AE can and probably should just do the low level communications. In my case the actual functions are VIs that contain the AE. These VIs are the only things that use the AE which is scoped private to them in a library.
=====================
LabVIEW 2012


0 Kudos
Messaggio 9 di 13
4.817Visualizzazioni

In the write command, you send exact command through serial, right?  In this way, the driver can't be used, correct?  What did you mean by other vis will create commands and parse results?  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Messaggio 10 di 13
4.810Visualizzazioni