LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous commands

 

Hello everyone,

 

I have a simple but confusing problem! Is there anyway to run two commands EXACTLY simultaneously in Labview by anymeans?

For example, is it possible to have two simple While loops counting simultaneously? I mean, both numeric shows the same number at the same exact?

I want to expand this idea to control two device exactly at the same time.

 

Thank  you all in advance...

0 Kudos
Message 1 of 5
(2,725 Views)

THere is asyncronzation palette that you should explore.

 

An occurence could be fired by one lood and monitored by the other loop.

 

You could do something similar  with semaphores but that may get complicated or convoluted.

 

An Action Engine could have an increment method in one loopAnd both loops loops can use a Read method on the engine and display the current value.

 

YOu could also use a queue driven from one loop..

 

A DVR (data Value reference) could store the common value.

 

Then there is the timed loop that can be configured to run at the same rate...

 

PIck your poison.

 

Go fo rthe simplest method that meets your needs.

 

Questions?

 

review the LV help then post away and maybe we can help.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 5
(2,715 Views)

Even on a multicore machine, nothing is guaranteed to execute "exactly" at the same time (unless you are running on an FPGA), but you can probably code it so the jitter is acceptable for your particular application.

 

I don't understand the arbitrary requirements that you are imposing on the problem. Why does it have to be two while loops? Why can't you place both codes in the same while loop (or even timed loop), automatically guaranteeing that thing occur together with each iteration?

 

(I also don't understand the reason for your picture. It does not really help illustrate the problem).

 

 

0 Kudos
Message 3 of 5
(2,706 Views)

@altenbach wrote:

Even on a multicore machine, nothing is guaranteed to execute "exactly" at the same time (unless you are running on an FPGA), but you can probably code it so the jitter is acceptable for your particular application.

 

... 

(I also don't understand the reason for your picture. It does not really help illustrate the problem).

 

 


 

I read the picture as the reason for the question becuase on a multi-cor machine it would be rather obvious tha the two loops are not in anyway syncronized.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(2,701 Views)

If you are wanting to send the same command to two instruments, then you may have to resort to low-level 488.2 commands.

 

A couple of years ago, I had to be able to reset two counters at the same time, and I had to use the ibcmd() .

0 Kudos
Message 5 of 5
(2,694 Views)