Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to collect data from a VI

I need help to collect data from a VI that I'm working on. I am creating a square wave to simulate motor speed and then I start a sweep function to slowly increase the simulated motor speed and I want to record the control response along with the generated square wave frequency when I trigger the square wave to start sweeping. 

I will not be able to respond to questions untill later this evening.

I think I have attached my VI here if i did it correctly for someone to look at.

Thanks

Brian.

0 Kudos
Message 1 of 5
(3,334 Views)
I made a suggestion from what it seemed like your goal was based on your post.  You may want to rethink structuring your code to prevent race conditions as described in this article. 
Regards,


h_baker
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,310 Views)

Thanks h-Banks,

As you can see I am a NooB at this programming stuff and I have a lot to learn.

After looking at the links you gave me I can see where I have a problem with this set up and I will attempt to make a producer/consumer VI.

However I am still having trouble getting the data gated to recorded only when the ramp function is operational.

I have tried a local Var set to the START SWEEP button but I have to change the mechanical action on the button and this causes the sweep FOR loop to run continuous rather than stopping after the first sweep. It starts the data recording at the correct spot but I don't know how to stop it at the end of the sweep loop.

 

Brian.

0 Kudos
Message 3 of 5
(3,297 Views)
OOPs sorry got your name wrong to.
0 Kudos
Message 4 of 5
(3,296 Views)

Hey Brian,

      I've looked at your code as well, and hopefully my changes help you.  You have a valid point about the mechanical action for the local variable- so I just didn't use a local variable.  I may have misinterpretted what you're looking to do- but hopefully it at least gives you some ideas.  Have a good one!

 

0 Kudos
Message 5 of 5
(3,264 Views)