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
(3,917 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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(3,914 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
(3,901 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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,889 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
(3,883 Views)
Solution
Accepted by 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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 10
(3,866 Views)
Solution
Accepted by 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
(3,830 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
(3,823 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
(3,822 Views)

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

 

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.

0 Kudos
Message 10 of 10
(3,805 Views)