LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate time delimited constant output signal on button press

The outputs do not get updated until the entire sequence finishes

 

I saw that it was noted that a flat sequence structure works like this (outputs doesn't get updated until the entire sequence is finished) but i didn't see an explicit statement that the sequence structure i use works the same way therefore i assumed that the outputs were available. But studying what happens I realize you're right. Maybe i didn't look close enough.

 

Your use of the merge and sequence structure show a lack of understanding of data flow and how LabVIEW works.

 

Its a visual programming language. It is meant to be easy! You're right, I got bored by the tutorials and jumped right in. I'll see if there's a tutorial that dont go into programming basics but only labview specifics. Ill try out the solution you suggested in parallell. Thanks!

 

 

0 Kudos
Message 11 of 18
(1,283 Views)

So I guess you don't know the answer? 🙂
I am sure i can provide or try on my one doing something like this in less than 30 minutes of time.....

 

I just gave you an option on how this could have been achieved. Please do not consider anyone to give you a readymade answer within a specifed time leaving their work behind....

 

If you would have browsed the examples that came along with LV probably you would have figured out a solution for the same instead of posting it on the forum.

 

 

Guru

Regards
Guru (CLA)
0 Kudos
Message 12 of 18
(1,265 Views)

No Guru, you didnt provide me with an answer to the question and of course i looked at examples and tried to find a solution on my own before i posted it here. I didnt expect a ready made answer - i hoped that someone could point me in the right direction.

 

Ive downloaded the DAQmx base package on suggestion by Dennis and maybe ill be able to resolve the question in a couple of days.

 

I do appriciate that you tried to help me though!

 

Rgds

0 Kudos
Message 13 of 18
(1,259 Views)
Analog output.vi
0 Kudos
Message 14 of 18
(1,252 Views)

ustsv75 wrote:

Your use of the merge and sequence structure show a lack of understanding of data flow and how LabVIEW works.

 

Its a visual programming language. It is meant to be easy! You're right, I got bored by the tutorials and jumped right in. I'll see if there's a tutorial that dont go into programming basics but only labview specifics. Ill try out the solution you suggested in parallell. Thanks!

 

 


While the graphical nature of LabVIEW does make it easier for novice programmers and nonprogrammers to implement basic tasks it does not negate the fact that programming in general is a nontrivial task. Designing a good and robust system takes skill and experience regardless of the language. The graphical nature of LabVIEW makes it easier for people to understand programming concepts but you still need to learn them in order to write good code. Because LabVIEW is a programming language you can't avoid learning programming basics as well.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 15 of 18
(1,234 Views)

Still don't think it beats text based programming languages but maybe Ill see the light soon...

 

Figured out that if I dig down into how square wave generation works I could learn a lot. Since it seems as if time is shifted from one iteration to the next (probe window) I need to save the start time somehow if I want to generate a time delimited pulse. I could then set the output value to the selected value as long as the set time hasn't elapsed and to zero after.

 

Square wave generation.png

 

 

Or, in a text based language I'd simply do something like this:

 

outputValue := 2;

Wait(2);

outputValue :=0;

 

That didn't take much skill 🙂

0 Kudos
Message 16 of 18
(1,225 Views)
You can do exactly the same thing. I mentioned that for a digital output and if I had been thinking straight, I would have mentioned that you can do it with an analog output as well. Both would be DAQmx Write, wait, DAQmx Write. with my original idea, the wait and the second write is in the waveform. Up to you. Embedding the wait in the waveform takes advantage of hardware timed output.
Message 17 of 18
(1,221 Views)

Solution.png

 

This is the solution I came up with. It's not so pretty but its working. It seems to be eating a lot of CPU power so its not so effective either.

It generates a positive signal for two seconds when switched and then it sends a refresh pulse for as long as the button is switched on. When switched off again it generates another pulse for two seconds.

 

 

I haven't understood how you would do the same with DAQmx write but im interrested to learn. Luckily I found this tutor that might guide me (http://zone.ni.com/devzone/cda/tut/p/id/2991). It helps to know what you're looking for. Thanks Dennis!

 

0 Kudos
Message 18 of 18
(1,206 Views)