LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem at the start of the execution of a VI

Solved!
Go to solution

I am creating a VI in Labview which consists in turning on a led indicator or another depending on the value that I enter in the Numeric Indicator.

 

This program I have already done and it works but I have a problem.

 

I can not use a mouse. I have a barcode reader (this works like a keyboard instead of pressing the keys and it works).

 

If you run my program you will find the need to use the mouse to set a number in the numeric indicator and I want this not to be so, I want to directly type the code or in my case read the barcode and write it directly.

I attach my program.

 

 

Captura.PNG

Captura1.PNG

 

 

 

0 Kudos
Message 1 of 10
(919 Views)

Hi aitorplaza,

 

set key focus to your input (that numeric control?) and scan the barcode. As the scanner acts like a keyboard the scanned number will automatically "typed" in the control. Most often the scanner will send a LF (or CR) character at the end of the message so the control is also updated immediately…

 

Did you search this forum for "barcode scanner"? Such request like yours are quite common here…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 2 of 10
(916 Views)

GerdW escribió:

Hi aitorplaza,

 

set key focus to your input (that numeric control?) and scan the barcode. As the scanner acts like a keyboard the scanned number will automatically "typed" in the control. Most often the scanner will send a LF (or CR) character at the end of the message so the control is also updated immediately…

 

Did you search this forum for "barcode scanner"? Such request like yours are quite common here…



Hi, 

thank you for your answer. I put the property node key focus, i changed it to write  but now appear another problem, the wire does not connect. It says that I can not connect a double with a cluster of 3 elements. How could I do it?

 

Thank you 

 

 

0 Kudos
Message 3 of 10
(903 Views)

Hi aitorplaza,

 

setting the "key focus" is not related to a physical keyboard at all! (Atleast not in the sense of needing to press a key on the keyboard.)

The "key focus" is a property of each control

 

Edit: so you edited your message as you found this property node on your own.

Now you should attach your current VI to allow us to solve the wrong wiring…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 4 of 10
(891 Views)

GerdW escribió:

Hi aitorplaza,

 

setting the "key focus" is not related to a physical keyboard at all! (Atleast not in the sense of needing to press a key on the keyboard.)

The "key focus" is a property of each control

 

Edit: so you edited your message as you found this propety node on your own.

Now you should attach your current VI to allow us to solve the wrong wiring…


Thank you.

 

As you can see, i can not wire it correctly, the message that appears is: 

 

 

Captura2.PNG

What could I do?Captura2.PNG

0 Kudos
Message 5 of 10
(885 Views)
Solution
Accepted by topic author aitorplaza

Hi aitorplaza,

 

why do you want to wire the control value to the error input of the property node?

What do you want to achieve with this wire?

 

Just pu the property node in parallel to your original code…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 6 of 10
(868 Views)
Solution
Accepted by topic author aitorplaza

What you are attempting here with that wire is fundamentally incorrect.  The input of that property node is an ERROR CLUSTER and should be used to 1) ensure data flow, 2) pass any existing errors though this section of code.  If this property node is in the initialization portion of your code (as it should be) the input can be left unwired.

 

The property node is already linked to the control (as indicated by the name).  you can also verify by right clicking the property node and going to "link to" to verify which control/indicator it operates on.

Message 7 of 10
(832 Views)

GerdW escribió:

Hi aitorplaza,

 

why do you want to wire the control value to the error input of the property node?

What do you want to achieve with this wire?

 

Just pu the property node in parallel to your original code…


Thank you, I finally got de idea!! 

0 Kudos
Message 8 of 10
(825 Views)

proland1121 escribió:

What you are attempting here with that wire is fundamentally incorrect.  The input of that property node is an ERROR CLUSTER and should be used to 1) ensure data flow, 2) pass any existing errors though this section of code.  If this property node is in the initialization portion of your code (as it should be) the input can be left unwired.

 

The property node is already linked to the control (as indicated by the name).  you can also verify by right clicking the property node and going to "link to" to verify which control/indicator it operates on.


Thank you, I finally got de idea!!

 

Now it works.Captura.PNG 

 

 

 

0 Kudos
Message 9 of 10
(824 Views)

Now that you have a working version, it is time to polish it up! Smiley Happy

 

Your control needs to be blue (integer, because orange makes no sense!)

 

How does the input translated into the LEDs? I am sure that using a single Boolean array would lead to significantly cleaner code.

 

You might need to ensure that the key focus is set before a scan is attempted. How does this code fragment incorporate into the rest of the code?

 

Especially if the number of input values are small consecutive nonnegative numbers, you could use an string array diagram constant and index into it using the input value.


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 10 of 10
(807 Views)