LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send "Ctl+C" command via the serial port

I am programming an application with Labview 8.6, which communicating with an embeded Linux system board. Due to need to interact with the UBoot, and if available, I must type the Ctl+C to break the uboot executing, this is so truble. So I want to send the “Ctl+C” via the serial port  and let the target system receiving. Any one can give a prompt? Thanks.

 

David

0 Kudos
Message 1 of 8
(12,975 Views)
Under Linux, Ctrl-C the interrupt key, as you know. It doesn't generate a character. However, the literal character for Ctrl-C is the value 3. So try to send the Ascii code 3 to the serial port.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 8
(12,969 Views)

This page is a great resource for this kind of information. From the ASCII Q&A section:

 

Q: What's the ASCII code for CTRL-A, or CTRL-Z?
A: The value for CTRL-A (^A) is 01. The value for CTRL-Z (^Z), which is often used as an end-of-file marker in DOS is 26 (decimal). All the other CTRL-B through CTRL-Y characters fall in between. (CTRL-B is 2, CTRL-C is 3, and so forth.) 

Message 3 of 8
(12,965 Views)

I think that have nothing to do with the UBoot, if want UBoot to receive the "CTL+C" signal, it should send "CTL+C" to the target CPU.

 

 

David

0 Kudos
Message 4 of 8
(12,928 Views)

What is "UBoot"?

 

The only character that can be sent by the serial port that is a Ctrl-C is the ASCII character 3.  It is also known as the ETX or "end of text" control character.

 

If sending the ASCII character 3 doesn't work for you, then you will have to provide more detail as to what "UBoot" is, what you mean by the target CPU, and your overall serial port communication setup.

 

Are you sure you are talking to this CPU using a serial connection?  A Ctrl-C on a keyboard will break running code, but a keyboard is not connected using a serial port.  A ctrl-C is a special keycode mapping.  The ctrl is a modifier key that the keyboard port knows how to handle to send the appropriate scan code.

Message Edited by Ravens Fan on 01-08-2010 09:05 PM
0 Kudos
Message 5 of 8
(12,925 Views)

UBoot is a kind of software to use to initiate the embedded firware and to load the OS such as embedded Linux. OK, I have get the result. I noticed that in the UBoot codes, there is a function used to monitor the" cancel" command from the keyboard, due to this command is also send via the serial port (because must observer the target system via a terminal tools), so  I just send the 0x03 to the target, it respond as I press the "CTL+C" .

 

 

David

0 Kudos
Message 6 of 8
(12,903 Views)

color wrote:

I think that have nothing to do with the UBoot, if want UBoot to receive the "CTL+C" signal, it should send "CTL+C" to the target CPU.

David


Is it not better to try thing out first. Before cocky brush it aside as a not working idea?



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 7 of 8
(12,893 Views)

color wrote:

I think that have nothing to do with the UBoot, if want UBoot to receive the "CTL+C" signal, it should send "CTL+C" to the target CPU.

 

 

David


 

As long as the device will accept characters over the serial port during its bootup then it will see the Ctrl-C and go into its Uboot state. I've done it before with microprocessors. 

0 Kudos
Message 8 of 8
(12,878 Views)