LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to clear numeric property automatically

Solved!
Go to solution

Hi I make subtract program with visa.

 

I attach my program.

 

When click the Task START button, program will be start.

 

User rest 15 seconds and do subtracting 15 seconds repeatedly.

 

In my program user delete the answer when user input the answer.

 

But, this delete procedure is inconvenient.

 

I want delete answer(numeric properties) regardless of  answer correct or not.

 

How can I do it?

 

In addition, How do the cursor automatically click the numeric properties When user enter the answer.

 

I want to make user enter the answer using only keypad.

 

0 Kudos
Message 1 of 5
(2,888 Views)

This is a wonderful example of how to "complexify" and "complicate" a task to the point where only you have a clue what is going on.  It also doesn't help that one needs to scroll the window in order to see the entire Block Diagram.

 

Here are some questions:

  • Why are you reading what appears to be text (but I cannot be sure) from VISA?  Is this an "external device", perhaps plugged into a USB Port?
  • Somewhere you need to describe the behavior of this VISA device.  Is it like many serial devices in that it outputs a (possibly-variable-lenght) string terminated by something such as <NL>, 0x0A?  If so, your VISA read should read in the entire string and then parse it.
  • I gather from the fact that there is a missing "BinaryToVolt" VI that possibly the device is some type of A/D converter that outputs voltages as U16 quantities.
  • I'm confused by the Data Acquisition routine which, despite looking extremely repetetive, fails to use a loop!  Why not?  It is also curious that you read 10 bytes from VISA, yet need 12 bytes in the decoding scheme.
  •  I didn't even try to understand what you are trying to do in the Cognitive Task.  One thing I recall is your request that the Answer come only from the keyboard -- the easiest way I can think to do this is to change the type to a String, restrict it to a Single Line, and use a Value Change condition to note when the value has been input (because the User typed <Enter>).  You'd then parse the line as a numeric, returning an Error Message saying "Numbers only, please" or something if you got non-numbers.
  • Learn to use Loops, Sub-VIs, and documentation. 

Bob Schor

Message 2 of 5
(2,838 Views)
Solution
Accepted by topic author Sangkyu
  • Why are you reading what appears to be text (but I cannot be sure) from VISA?  Is this an "external device", perhaps plugged into a USB Port?

A: Yes, I receive the data from MCU by UART communication. 

 

  • Somewhere you need to describe the behavior of this VISA device.  Is it like many serial devices in that it outputs a (possibly-variable-lenght) string terminated by something such as <NL>, 0x0A?  If so, your VISA read should read in the entire string and then parse it.

A: The sending data is data of  multi channels, so labview program have to distinct each data.

The 0x0A is protocol of communication.

 

  • I gather from the fact that there is a missing "BinaryToVolt" VI that possibly the device is some type of A/D converter that outputs voltages as U16 quantities.

A: BinaryToVolt convert uint16_t data to voltage scale(0~3.3V range).

  • I'm confused by the Data Acquisition routine which, despite looking extremely repetetive, fails to use a loop!  Why not?  It is also curious that you read 10 bytes from VISA, yet need 12 bytes in the decoding scheme.

A: The data is send continuous every 5ms. So VISA read data repeatedly.

    In my program VISA part has not problem.

 

  •  I didn't even try to understand what you are trying to do in the Cognitive Task.  One thing I recall is your request that the Answer come only from the keyboard -- the easiest way I can think to do this is to change the type to a String, restrict it to a Single Line, and use a Value Change condition to note when the value has been input (because the User typed <Enter>).  You'd then parse the line as a numeric, returning an Error Message saying "Numbers only, please" or something if you got non-numbers.

A: Simply, I want to make calculator like window calculator program.

  It can input the value and Enter without delete the before value.

  Ex) input 10, enter, input 7, enter, input 9, enter. 

  But my program,  input 10, enter, click numeric properties, delete value, input 7, enter,  click numeric properties, delete       value,  input 9, enter

 I want to click numeric properties, delete value, procedure.

 

  • Learn to use Loops, Sub-VIs, and documentation. 
0 Kudos
Message 3 of 5
(2,806 Views)
Solution
Accepted by topic author Sangkyu

Here's an outline of a routine that poses a random addition problem (you can also have it do subtraction and multiplication -- division will be trickier -- by making the "op code" randomly "+", "-", or "x").  You use the keyboard to input your answer, then hit <Return> to enter it.  At present, you need to click/clear the answer for the next round, but you can also programmatically clear it (I'll leave that as an Exercise for the Reader).

Cognitive.png

Bob Schor

0 Kudos
Message 4 of 5
(2,780 Views)
Solution
Accepted by topic author Sangkyu

Thanks  ,

 

I solve very simple method.

 

The key focus select value, and i can input only value and enter.

 

I attach my solution below.                      

0 Kudos
Message 5 of 5
(2,778 Views)