LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter

Then you should be sending 02 00 00 03, with the constants all set to show hex display.  (Do it in one constant rather than concatenating 4 of them together.)

 

I have no idea why you are trying to send 30 30 and 03 in normal display.  They are doubly wrong.

 

Since it is asking you to send STX and ETX characters (which are value 2 and 3 in the ASCII table), I'm sure it wants you to send the computer ID and address as the actual values of the bytes as well rather than as the ASCII characters of "0".

0 Kudos
Message 11 of 19
(769 Views)

Hi,

 

OK thanks. But how can I be sure I need to send an Hex or ascii message?

Because what you're giving me is in Hex, but in the document it is written "code ascii" just above §2.1.

 

Best Regards

 

Pierre Samson

0 Kudos
Message 12 of 19
(752 Views)

This will be the third time that I have said the four string constants you are using to build the string do not all have the  same display format.  Others have mentioned it as well.  Whether you need to send Hex or ASCII isn't going to matter as long as you are not consistent in the format you send.  As RavensFan said, use one string constant instead of building a string from four constants.  Then you can try both formats to see which works.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 13 of 19
(748 Views)

OK, I did change th four string to one wen I was told. I'll try the different languages

0 Kudos
Message 14 of 19
(745 Views)

@pierre123456 wrote:

Hi,

 

OK thanks. But how can I be sure I need to send an Hex or ascii message?

Because what you're giving me is in Hex, but in the document it is written "code ascii" just above §2.1.

 

Best Regards

 

Pierre Samson


ASCII is just human-readable hex (except when the hex characters are non-printable - pull up an ASCII-hex-decimal converter table from the Web, then you'll see what pierre is talking about). If you set your string display to hex, you can see all the stuff under the "boxes" which makes sense to the machine. When you need to send a command like

 

INSTRUMENTSELFDESTRUCT=0

 

over your serial port, the command is all sent as ASCII characters, and the "0" is 0x30 (hex 30). If you start setting all your string displays and controls to hex, you'll start thinking in hex and the dialog will make much more sense (1003 is much quicker for me to recognize than ETX). Don't worry, though, you won't automatically grow a weird red glass eye, a metal exoskeleton, a voice with a self-generated echo, and a laser pointing out from your arm unless you have already switched to LV2013f3 Smiley LOL .

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 15 of 19
(738 Views)

@pierre123456 wrote:

Hi,

 

OK thanks. But how can I be sure I need to send an Hex or ascii message?

Because what you're giving me is in Hex, but in the document it is written "code ascii" just above §2.1.

 

Best Regards

 

Pierre Samson



It doesn't say send it in ASCII.  Which really doesn't mean anything anyway.  Normal display is not the same thing as ASCII.

 

It says send STX which is ASCII code 2 which is a byte value of 2,  and ETX which is ASCII code 3 which is a byte value of 3.  I'm quite sure you are supposed to be sending hex 2 and hex 3 because the values of STX and ETX have no meaning beyond what is shown in an ASCII table.

 

Looking at examples later in the manual, it looks like the ID and address are supposed to be sent as the characters "0" and "0".  So you need to do two things.

 

For your ID and address that are right now in normal display, change them to say 0 instead of 30.

 

For your last byte, the ETX, change it to hex display and enter 03.

0 Kudos
Message 16 of 19
(730 Views)

Yes my adress and ID are 0, but if I chose 30 on the VI (also tried 0 since) it is because Hex: 30 = 0 .

 

0 Kudos
Message 17 of 19
(724 Views)

@pierre123456 wrote:

Yes my adress and ID are 0, but if I chose 30 on the VI (also tried 0 since) it is because Hex: 30 = 0 .

 


Dont' do that.

 

You can send 30, but make sure that when you enter 30 you have it set for Hex display.

If you have it set for normal display, then send the character 0.

 

Right now you are sending 2 bytes, character 3 and character 0.

0 Kudos
Message 18 of 19
(720 Views)

I just downloaded and read the operating manual.  While it is slightly vague I believe the entire command line, with the exception of STX (02H) and ETX (03H) needs to be sent as ASCII characters.  Addresses need to to ASCII characters so zero is 00.  No white space is allowed.  SO you would need to send 02 in hex followed by ASCII "0000" followed by 03 in hex.

 

From the manual:

Example:
General <STX> Address Line <ETX> (Address=35; Line=02)
Ascii <STX>3502<ETX>
Hex 02H,33H,35H,30H,32H,03H

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 19 of 19
(708 Views)