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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running two different VI codes simultaneously

Hello guys

 

I am conducting a study in which I am required to run multiple codes for different harwares simultaneously, I have the vi codes for them, I am looking for suggestions on how I can integrate them in such a way that all of them run simultaneously, can I use "Sync" option provided in the pallate. 

 

Please suggest

 

Thanks in advance 

 

Best

 

Deependra

 

P.S-  All the hardwares are independent and I am not using any chassis to sync them externally, I only need to integrate the vi codes

0 Kudos
Message 1 of 12
(3,457 Views)

Do you just want to run them in parallel or do they need a fixed timing relationship with each other.

 

If they should all run in parallel just call them from the same block diagram at the same time. LabVIEW will take care of the rest.

0 Kudos
Message 2 of 12
(3,453 Views)

Hello Altenbach

 

Thank you for your response, yes is very vital that they all run at the same time, is it possible for you to elaborate it, as I am new to this software and still learning all the terminologies. 

 

I am conducting a musculoskeletal disorder study and I have a VI code for an EMG (wireless) and a force plate. 

 

Thanks ina advance

 

Deependra 

0 Kudos
Message 3 of 12
(3,447 Views)

SubVIs without data dependency always "run at the same time" if called in parallel. You need to be more specific.

0 Kudos
Message 4 of 12
(3,434 Views)

I have 2 VI codes, 1 VI code belongs to an EMG machine and the other belongs to a force plate, I am trying to figure out how to run these two aforementioned codes simultaneously. 

 

I am uploading the codes for your reference. 

 

Thanks 

Download All
0 Kudos
Message 5 of 12
(3,430 Views)

The trigno...vi" will stop after one iteration of the loop. (unless it gets trapped in a subVI that you did not attach)

The "Single....vi" wil run until the stop button is pressed (unless it is trapped inside one of the deeply stacked loops 🐵

 

It is still not clear what you want. You can start them both at the same time, but it does not seem to make a lot of sense.

How old is this code? The trigno seem to be from an age where index array was not resizable (LabVIEW 4.1?)

 

You need to be much more specific what you want.

0 Kudos
Message 6 of 12
(3,428 Views)

These are the codes I received from the company, even I am not sure how old they' re, and there's a whole bunch which supports them, so, it might not have worked and the trigno code won't run without the EMG machine. I just uploaded them, so that you can just have a look at it, could you please just give me a little bit of direction on how can put them in a single block diagram (like you mentioned earlier) and call them. It will serve as an exercise for me as well, as I am trying to learn this software. 

 

Thanks 

0 Kudos
Message 7 of 12
(3,420 Views)
  • create a new VI
  • drop both vis as subVIs on the diagram
  • run the new VI

(I doubt this will solve your problems... :o.)

0 Kudos
Message 8 of 12
(3,417 Views)

Yes you' re right, it doesn't Smiley Sad, I have already tried that.. 

 

Do you have any other suggestion, here's what I am trying to do. 

 

We' re trying to conduct a study on lower back disorders, this study would involve human subjects performing pre defined tasks, and using those tasks, we' ll do the DAQ, the subject would do the task like lifting weight or body movements whilst standing on the force plate and the designated portion of his body would be attached with censors for EMG collection. 

 

We' re trying to control the EMG and the force plate using LabVIEW, now for the data acquisition, it is very important that these two codes run simultaneously, as we' re trying to do the DAQ from both the force plate and the EMG. 

 

That's why I am trying to find a way in which I can integrate these two codes such that they both run simultaneously. 

 

Thanks

0 Kudos
Message 9 of 12
(3,413 Views)

Are you just reading from the EMG and force plate?

 

I'm not hearing anything that says you need absolute synchronization.  So I would just run them as two separate subVIs.  You will want to get away from the example and use the actual driver VIs.  If they both are just reading, them put then in the same loop.  Read the EMG then read the force plate.  Do whatever with the data and loop through it again.  This usually works well as a Queued Message Handler.


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
Message 10 of 12
(3,376 Views)