LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

needed help using event structure

Hi,
Iam using the event structure to change the value of the amplitude that is fed into Simulatesinewave.vi. The value that Value_outtosine displays should be set as the amplitude to simulatesinewave.vi. the output waveform from this Sinewave.vi is sent to voice-coil. Rightnow the value is changing,but when i place DaQAssistant or connect Value_outtosine to sinewave.vi, the program doesnt work the way it is supposed to.Iam attaching the vi code, any suggestions are really helpful. Please reply if you have any questions about the working of the program.
Thanks a lot,
S.
0 Kudos
Message 1 of 4
(2,629 Views)
You know, I took a quick look at your program, and the term "Rube Goldberg" came to mind. Especially with what you're doing with the Boolean operations there. You really need to simplify your code.

In terms of what you said: "but when i place DaQAssistant or connect Value_outtosine to sinewave.vi, the program doesnt work the way it is supposed to", what exactly do you mean? You have no such thing in your VI. Where are you placing this?
0 Kudos
Message 2 of 4
(2,606 Views)
Hi,
Thanks a lot for having a look at the VI. Iam attaching the vi with simulatesinewave and also daqmx placed. If you run the previous vi and see how the value_outtosine value changes,that is how i wanted the vi to run with simulatesinewave and DaQmx placed. please reply if you have any other questions.
Thanks again.
S.
0 Kudos
Message 3 of 4
(2,598 Views)
I don't say this often, but your VI is a perfect example of when you need to start over. Your VI is a complete mess. I thought the first VI was bad. This one called wednesday1 is worse. Definitely Rube Goldberg. You've got hidden controls all over the place, local variables all over the place, constants that seem arbitrary, and you're comparing boolean controls against a True/False constant, and feeding the result into a Boolean function, which is redundant! I have no idea why you thought that you needed the contraption that you built in order to just toggle the amplitude of a sine wave based on a duty cycle specified by two numeric controls, but my suggestion is to seriously reconsider your approach. Trying to debug the VI you wrote or even modify it is an exercise in futility.

It is not my intention to hurt your feelings on this, and I suspect the problem with your VI is the way you have the DAQmx stuff set up. Unfortunately, I don't have DAQmx installed so I can't check what you did with that, but sometimes the best help you can give someone is to tell them to start over.
0 Kudos
Message 4 of 4
(2,576 Views)