LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ESCAPE function in keyboard

Hello.
 
I am making this multi purpose keyboard for my application which includes alphabet, numbers and for my sensor control commands. Please see the attached VI. I want to add the "esc" function (Case 59) but i do not know how.
 
Can anyone please teach me how to make the "esc" function in my keyboard. Thank you very much.
0 Kudos
Message 1 of 10
(3,472 Views)
Right-click on a new string diagram constant and select "hex display". now enter 1B for esc. (Type keyword "ASCII codes" in the online help for the full table of codes.)
 
(Your program is way too overly complicated. 😉 Many case differ only by diagram constant, so you should be able to re-use the code. For example you could predefine a size 64 string array that contains all the right strings at the right location, then simply index into it using the event number.  Also, why is there a control named "value" ... shouldn't that be an indicator? Make it an indicator and just wire it inside the loop to the right of the left shift register. Now delete all of its local vaiables.)
0 Kudos
Message 2 of 10
(3,456 Views)

Thank you for your kind reply. I modified my VI as attached.  This will be a pop up keyboard for the user in the field. So, everytime the user wants to calibrate the sensor, he will just put the cursor on the "string to write" and the keyboard will pop-up.

"you could predefine a size 64 string array that contains all the right strings at the right location, then simply index into it using the event number."-I will try to study how can I modify to this.

May i ask additional question regarding the result i am getting after i put the command "hardiron cal". Kindly see the attached screen shots. The first screen shot is my sample LabVIEW VI and the second is the hyperterminal. In the hyperterminal, once i log "hardiron cal", it will give me directions including the Xmin, Ymin, Xmax, Ymax and lastly the offset value. But in my sample program, I can get the directions, but i can't read the min. and max. values. What i am getting is "*" (asterisk) only, i.e.

-36.8    150.3 *
-36.9    149.7 *
-36.7    150.3 *

Why do you think this is happening? I would appreciate any advise. Thank you very much.

 

0 Kudos
Message 3 of 10
(3,435 Views)
Hi Bong,

I'm a bit confused by where the Max/Min function is taking place.  Is this information that the instrument should return after it receives the "hardiron cal"?

Assuming that this is the case, you can check the instrument's response to this command through Measurement and Automation Explorer (MAX).  Under My System in MAX, expand the Devices and Interfaces tab and the Serial & Parallel tab as well.  Then, select the communication port on which your instrument is attached.  Select the Open VISA Test Panel option from the toolbar in MAX.  Click on the Write tab, and write your command, "
hardiron cal" instead of the default "*IDN?".  Click the Execute button.  Now, click on the Read tab, and click the Execute button.  This should return the information from the instrument.  Does this information match your expected results?  Is the command functioning correctly in MAX but not in LabVIEW?  If the command does not function in MAX as expected, maybe another command should be used.

Please let me know what information you find after running in MAX.  Best of luck on your application, and have a great day!!!
Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 4 of 10
(3,403 Views)
Dear Mr Ching,
 
Thank you for your reply. I followed your instructions and were able to get the following results. Please see the attached screen shots. The first and second test is using MAX, the third is Hyperterminal and the last is my sample VI.
 
"I'm a bit confused by where the Max/Min function is taking place.  Is this information that the instrument should return after it receives the "hardiron cal"?"
- "hardiron cal" stands for Hard Iron Calibration. I am evaluating an EZ Magnetic Compass 3 Sensor (AOSI). Normally, after i log "hardiron cal", the device will instruct me to rotate the sensor. As I rotate the device, the Xmin, Xmax, Ymin and Ymax will return. This is some kind of offset calculation from the device. But if you look on my sample VI, thought i rotate the device I can only get one return or sometimes nothing. On the otherhand, the hyperterminal shows Min/Max calculation on every small rotation of the device.
I have tried to change the delay timing and millisecond multiple but got the same results.

What are other options i can do or test? Thank you for your kind help.

regards,

bong


0 Kudos
Message 5 of 10
(3,384 Views)

Hi Bong,

Looking at this information, it seems that there is some step that your instrument requires between each execution of this command; something similar to a reset.  The reason I say this is because the function is not functioning correctly in MAX or LabVIEW.  MAX allows commands to be sent directly to the instrument, eliminating the possibility of programming error.  Please review the user manual for your instrument, and see if there is a different command that should be used or if there is something that should be used between each execution of this command.

Please let me know if you have any further questions.  Best of luck on your application, and have a wonderful day!!

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 6 of 10
(3,348 Views)
Hi Mr Ching,
 
Its been a week of checking/changing/revising my VI, but i dont really know what i am missing on my VI.
Improvement so far on the VI;
- when i log the "hardiron cal", the sensor will respond and start calculating. But the my problem right now is it will end by itself. It is me or the user who should hit any key or press enter and the sensor will terminate its calculation.
 
I am attaching a screen shot of the VI and the commands for the sensor. Any advise or any hint i would really appreciate.
 
thanks a million.
Download All
0 Kudos
Message 7 of 10
(3,282 Views)
Hi Bong,

I have looked through the screen shots that you attached, and could not see anything that seemed out of the ordinary.  It seems that the code will stop if you press either the OK or the Cancel button.  If this not the case, it could possibly be something with the "hardiron cal" command.  The LabVIEW code doesn’t seem to have anything that could be causing this. 

 

Does the “hardiron cal” command work in Measurement and Automation Explorer without stopping?

Please let me know if you have any other questions.  Best of luck on your application, and have a great day!!

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 8 of 10
(3,246 Views)
Hi Mr Ching,
 
Thank you for your suggestions. I was able to find the trouble in my VI. I had a problem about serial buffering. I can't control the amount of data coming from the sensor which gives me strange results.
Getting back on the previous threads on this forum i read about the original codes from Mr. David Thompson which he used classical String Functions.
His example programs help me find the way.
 
Thanks a lot.
 
 
0 Kudos
Message 9 of 10
(3,203 Views)
Hi Bong,

Thank you for letting me know that everything is working well.  Best of luck with the rest of your application.
Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 10 of 10
(3,179 Views)