LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I Need Help Combining 2 Programs

Hello sir,

 

I ask for help, previously I have made 2 programs using Lab View

1. calculate RPM (DAQ Assistance)
2. mass reading (VISA)

 

Unfortunately, I calculated that both use different microcontrollers. RPM with USB-6008, Mass with Arduino

Now my plan is to combine the 2 programs, previously the programs ran if opened separately, but I am having difficulty combining them, can anyone help me deal with this problem?

 

Please help
Thank you very much,

 

caption:
*Top code is the mass reading code using loadcell, hx711, and arduino
*Bottom image code calculates RPM with proximity and USB-6008

Hanif25_0-1718633484995.png

 

0 Kudos
Message 1 of 6
(393 Views)

The two loops run in parallel, if you want them to stop together with one stop button, you need to add a functionality called Queue Messages to exchange messages between the two loops.  One option is to use  master/slave design pattern where one loop is the master and the second is the slave. 

 

The stop button is on the master loop, when the first one stops, the second receives the message and stops too. 

 

 

LVNinja_0-1718635212160.png

 

0 Kudos
Message 2 of 6
(376 Views)
will this work on 2 controllers running simultaneously?
0 Kudos
Message 3 of 6
(361 Views)
Thank you for the help will this work on 2 controllers running simultaneously?
0 Kudos
Message 4 of 6
(361 Views)

@Hanif25 wrote:
will this work on 2 controllers running simultaneously?

Yes, if you write the code correctly.  There are a number of problems, however with your code.

  • The VISA Loop will stop when a boolean Push Button control (called "Boolean", a very poor choice for a name) is pressed.  I'm assuming you don't know about a feature of Boolean Controls called "Mechanical Action", which makes the Boolean Push Button act very differently than the rectangular buttons such as "Stop".  Please learn about Mechanical Actions (ask a colleague or teacher).
  • The bottom loop will (probably) never run!  The Stop Button has been wired to the "Continue" button, so when the button is not pushed, the loop will run once and stop (because you wired "False" to "continue".
  • Please get rid of the scripting!  LabVIEW has plenty of numeric and other functions to do computations!

Bob Schor

Message 5 of 6
(342 Views)

Re-

Okay sir, now I'm starting to understand why this code can't run simultaneously

Sorry, I'm still using the default name, and it's true, I'm still unfamiliar with LabView

Yes sir, I will start trying to remove the scrip, thank you for the knowledge

0 Kudos
Message 6 of 6
(315 Views)