LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a stop button to send commands through serial port and end labview vi?

Solved!
Go to solution
I only have labview 7 on this computer at work unfortunately I'll have to look at it later on my computer at home.
0 Kudos
Message 11 of 43
(2,175 Views)

I put in a request on the forums to have the VI converted to 7.0 for you,

I will post it here if someone helps me out.

Cory K
Message 12 of 43
(2,167 Views)

superomario wrote:
Why can't I use the same serial connection? I don't think I have much of a choice, the devices work in such a way that the first device is the only one connected to the computer and the next one is chained to the firsts "out" port  and so on. So all the data is sent to the first device and if the address does not match it is sent to the next one down the line until the right address is found. How else can i do this? And i know the code is neither perfect or robust but I cannot think of any other ways to do these things. Someone posted on another thread of mine recently and what he suggests is incredibly complicated for me to do at this stage. So any simple recommendations you can suggest would be great
That makes no sense to me. No matter what, each write will happen with no error whether you have anything connected or not.  That's the way RS-232 works. There is nothing in your code that 'finds' anything.
0 Kudos
Message 13 of 43
(2,160 Views)
OK I know this is probably the worst way to code this and I ultimately have no idea what I am doing as this is all very new to me. But this program generally works. Is there no way to make this better without a complete overhaul?
0 Kudos
Message 14 of 43
(2,140 Views)
You've just made it worse and you have not really listened to any of the advice.. Wait until you get home to look at Cory's example or wait until it gets downconverted.
0 Kudos
Message 15 of 43
(2,128 Views)
Here you go 
Cory K
Message 16 of 43
(2,116 Views)
Thanks Cory for getting that to me. Can someone explain step by step what is going on though? And how to make everything work better?
0 Kudos
Message 17 of 43
(2,090 Views)

First, the RUN command is sent to all 3. Then in the while loop, the RAT command is sent to all three along with the ULN and value fron the front panel controls. When the Stop button is clicked, the STP command is sent to 00. It will be up to you to add the code to send STP to 01 and 02.

 

The building of the control array and it's being autoindexed by a for loop is explained in the LabVIEW help and the tutorials I mentioned earlier.

Message 18 of 43
(2,083 Views)
How can I make the constant in the address option in the first visa write box, say 00 01 02 instead of 0 1 2? Is there a way to change the formatting?
0 Kudos
Message 19 of 43
(2,082 Views)

Look at how I did it in the other 3 For loops.

Do you see the blue 'i' that is wired up to the 'number to decimal string'.

Do that exact same thing, and it will give you 00, 01, and 02.

 

(I attached a new version with this step completed) 

 

And thank you Dennis for providing that explanation

Message Edited by Cory K on 06-03-2010 09:56 AM
Cory K
Message 20 of 43
(2,065 Views)