LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

the stop button is not responding when i needed to stop a program

Solved!
Go to solution

What is the purpose of the lower two loops? Since they are running in parallel to the rest of the code, all you ever get is the 50ms wait time. Seems rather boring!

 

  • You still did not change the mechanical action of your buttons to latch action.
  • You still did not place the buttons into their respective cases and change the event from "mouse down" to "value changed". Having the latch action boolean terminal inside its event case ensure that it resets to FALSE once the event has executed. A good troubleshooting tool. It also allows finding the related code easily by double clickin the terminal. It will get to to the respective event frame and associated code instead of some boring location outside the bulk of the code.
  • (case x81) Are you aware that "index array" is resizeable  Only one instance needed!
  • (case x81) Why don't you merge the two case structures into one? They run in parallel anyway.
  • (case x81) You can wire the numeric directly to the case selecter. Make one case x81 (change the radix display) and the other the default.
  • I would make the LEDs round, not oval.
  • Again, the timing seems to be determined by the instrument, nothing you can fix directly with LabVIEW code.
  • Don't overdo the front panel with too many decoration frames. We are no longer in the 1990ies!
Message 11 of 22
(1,781 Views)

Let's fix the problems in your code that you haven't fixed yet.

 

Attached is an updated VI you should work with.

 

Also, you should try typing your questions in your native language into Google and allow it to translate for you.  You seem to be typing things as to how you think English sounds, but not as it actually sounds or is written. 

 

 

As for your VI, there is nothing in there I can see that would cause delays other than how quickly the instrument will respond to requests for information.

 

Message 12 of 22
(1,775 Views)

Here is a slighly more cleaned up version that implements my suggestions. Again, your delays are external.

 

Modify as needed. You need to be careful when averaging U16 values. The sum might exceed the valid range.

 

(I left the instrument IO code as is. No guarantees that it is reasonable. I don't do serial)

 

You need an event for the stop button!

 

 

Message 13 of 22
(1,750 Views)

RavensFan wrote:

As for your VI, there is nothing in there I can see that would cause delays other than how quickly the instrument will respond to requests for information.


Well when the stop button is pressed, there will be an infinite delay (or until one of the other buttons is pressed again, whatever is shorter) until the VI stops. 😄

Message 14 of 22
(1,741 Views)

@altenbach wrote:

RavensFan wrote:

As for your VI, there is nothing in there I can see that would cause delays other than how quickly the instrument will respond to requests for information.


Well when the stop button is pressed, there will be an infinite delay (or until one of the other buttons is pressed again, whatever is shorter) until the VI stops. 😄


True.  But I assumed that the OP had fixed that problem when he changed topics and moved on to the new question about loop delays.  Seeing how everything else in the code wasn't fixed, I must have made a very big assumption

0 Kudos
Message 15 of 22
(1,706 Views)

thanku soo much sir 4 our help...  dis is working quite nicely....

0 Kudos
Message 16 of 22
(1,626 Views)

@altenbach- sir the attachment u modified for me is working well except for the fact that it is showing one error... i.e. actually measure range in the program has no response  so when i press range data request button after measure range button den it is taking tym to send data n also it is showing error which i have attached below... i want that measure range n range data request button to work simultaneously..clicking one after another.... sir u have send me the modified solution thats why i am asking this doubt to you....plz sir this one is last error in this program so plz send me the solution for dis.....

Download All
0 Kudos
Message 17 of 22
(1,590 Views)
You need to check what the returned data structure is. Instead of unflatten to a cluster, you could unflatten to a u16 array (if the number of bytes is always even) or parse the string in some other way. Check the instrument docs for the detailed format of all possible responses. I cannot determine that. The solution will only require minimal changes to the code. You could unflatten to a u16 to select the case and parse the remainder string in the respective cases.
0 Kudos
Message 18 of 22
(1,573 Views)

sir i tried doing this but it is working......... sir can u please explain it through a attachment?????

it would be really helpful for me.........thnku..

0 Kudos
Message 19 of 22
(1,560 Views)

@thakurshubh wrote:

sir i tried doing this but it is working......... sir can u please explain it through a attachment?????


If it is working, why is there still a problem?

 

As I said, I don't have the documentation for the instrument, so I don't know what the possible reponses, their lenght, and their format is. Do a quick test VI where you simply display the returned binary string for all possible queries. Display them in hex format in a string indicator and tell us what they are.

Message 20 of 22
(1,546 Views)