LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combo box to code



treadagon wrote:

What are the shift registers and what is their use?
Why you used a for loop?
Why you used the timeout event structure while reading?
What is the array you build in the start event structure?
Why the empty string?


Hi, I strongly recommend you to undergo a LabVIEW Basics course which is 2 parts, I & II.
 
Or else, browse thro' the NI site for online LV tutorials, that ll help you more.
 
1] SRs are this. They will hold the old values also.
2] He has used a While loop, not a For loop.
3] The Timeout event in the ES will not get executed because the value for it is -1 sec (if left unwired, default value for timeout is -1).
4] There are 6 arrays at the start of the ES, which one do you point out?
5] Empty String is to reset the SRs at the beginning of the program.
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 31 of 62
(1,391 Views)

See here for Shift Register Initialisation. Smiley Happy

Also, this to know more about them.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 32 of 62
(1,388 Views)

Hi treadagon,

1) already answered by Partha,
2) i use a for loop to send the necessary commands to the device
3) i use it, so that you can send the reboot and stop event while the device is running.
4) that is the command array which is used in the loop described in 2)
5) You need not all commands, it depends on the selected mode, so i check in the for loop if the string is empty. If it is empty nothing happens and if not the specified command will be send.

Hope it helps.

Mike

0 Kudos
Message 33 of 62
(1,387 Views)
Ηellο friend Partha!!! Before I start working with labview I completed the (7 I think) excercises that exists in your manual. From there is all the knowledge I got. Where should I learn the things you're refering to? Is there a link in ni.com with a video or something? (I was searching there before I discover this forum)

All the things that my friend Mike proposed I followed them to the letter because of my ignorance I don't have the ability to judge them OR develop them.

Mike, what should I change because when I press the start button the device measures 2 times repeatedly? Does the for loop send the command twice? And why do you believe the indicators are empty all the time even in the end of each measurement? Do you believe that some adjustment is needed and where should I look for?
0 Kudos
Message 34 of 62
(1,379 Views)
Hi treadagon,
check the stop condition in the timeout event. I´m not sure if everything is like your device need it. You can also use the highlight function to see what happend while your vi is running. To learn more about LabView you can start with the free courses. See this link: http://www.ni.com/academic/lv_training/d/how_learn_lv.htm
 
Mike


Message Edited by MikeS81 on 06-10-2008 10:21 AM
0 Kudos
Message 35 of 62
(1,377 Views)
Thanks for the advices. I will start my courses tomorrow. I will discuss with my supervisor about this. Although I don't believe we (me and you) were wrong. Take a look at the attached.

Thanks A LOT again!
0 Kudos
Message 36 of 62
(1,353 Views)
Hi treadagon,
where do you have problems currently? What does not work like you need it? The vi should make the same as your vi before.

Mike
0 Kudos
Message 37 of 62
(1,346 Views)
Well, the only proven method that shows labview communicating with my device is through case structure and buttons. So I'm thinking to put an ok button near each combo box and this ok button trigger the command that will go to visa write block. But I don't see in your vi where the combo boxes are going to a visa write block. All they are going to shif registers.
About the 2 problems I mentioned I encountered before: I'm thinking 1st to remove the for loop, so I can experiment if it affects the device and taking a measurement twice. About the 2nd problem I couldn't figure a solution and I would like to discuss about it. I want the measurements appear on the indicators and STAY there until I press a "clear" button. Although I don't know how to design the program of this button.
0 Kudos
Message 38 of 62
(1,333 Views)
Hi treadagon,
see the picture please. This is the part were the combo box value are connected with a "Visa Write" block. The first three string shift registers are the combo box values. To add a clear button, insert the button, create the value change event and connect an empty string constant to this three shift registers. Don´t forget to connect all other tunnels with wires.
 
Mike
0 Kudos
Message 39 of 62
(1,330 Views)
Hello Mike,
With a computer professor we checked the program. We put a LED at the exit of the string compare and it never blinks (weird!!). We read the manual again and it says that between 2 commands must not be lesser than 10ms. Anyway I don't think that anywhere I'm sending a command quicker. So I'm thinking before the VISA read block to put a time delay (or shall I put it between VISA read and string compare?) The only proven way to have connection with the device is with a button and a case structure. So I'm thinking near every combo box to place a "send" button.
What is your opinion for the actions I'm about to do?
How will I do this delay?
Is this related with the timeout event?
Why have you chosen the timeout event and what is this "-1"?
Message 40 of 62
(1,303 Views)