LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i take certain text strings and turn them into specific ASCII commands?

I am able to control hardware using ASCII code. These strings can be up to 10 letters long and can take much of my time to give commands to this hardware. Is there a way that i can type in one ASCII key in order to correspond with a longer ASCII string. For example, one command is aIP1000S12R. Is it possible to program labview to read one letter and to convert it to this longer string?So i could type P into my program but the program would read aIP1000S12R?

 

This might be a ridiculous question, but i am new to labview

 

Thanks

0 Kudos
Message 1 of 5
(3,048 Views)

Hi Gillyme,

 

what about using a case structure?

 

Wire the string control (your input) to the selector of the case structure, create a case for each "command" you want to have and output the needed string from the case. You can make the case selector case-independent, if needed...

Message Edited by GerdW on 02-10-2009 06:49 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(3,044 Views)
Why even try to enter the cryptic "P". Why don't you use the model of all instrument drivers and have some some logically named controls on the front panel and build the string dynamically? For example, if you were programming a power supply, all you would need on the front panel is a numeric control that represents the output voltage. the program would then format a string in any manner it needed to and send that.
Message 3 of 5
(3,039 Views)
Could you give me an example Dennis.This solution would be ideal
0 Kudos
Message 4 of 5
(3,007 Views)
At the Instrument Driver Network, there is a section at the bottom. Click on the 'Learn to Build Instrument Drivers' tab and you will see a lot resources on drivers. You also have a shipping example. Go to your Instrument I/O>Instrument Drivers palette and look at the Agilent 34401.
0 Kudos
Message 5 of 5
(3,002 Views)