LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex per CAN versenden

Hallo.
Ich muss auf meinem CAN-Bus 6 Byte im Hex-Format versenden:
Byte:              0     1     2     3     4     5     6     7
Hexwert:       01   01   40   88   00   00  leer  leer
Wie kann ich diesen Hexwert direkt verschicken?
Oder muss ich diesen Hexwert vorher konvertieren?
0 Kudos
Message 1 of 10
(2,966 Views)
You can put your string control in HEX mode. Right mouse menu  Smiley Surprised
0 Kudos
Message 2 of 10
(2,959 Views)

Hello KC.

Thank you for your Answer. The mode of my string control is already Hex mode. The problem is, that the wire between my string constant an the CAN send VI ist broken if I connect them. The Error message is that the Datasource ist string and the Data sink is 1D Array of double. Is it possible to but the Input mode of the CAN send VI into HEX mode? When I press the right mouse button I don´t have the alternative to select HEX mode!

Thank you

0 Kudos
Message 3 of 10
(2,945 Views)

Hi,

Then you have to convert the string into a array of numbers with the 'string to byte array' function.

0 Kudos
Message 4 of 10
(2,941 Views)

Hi KC.

I have testet your suggestion but the problem is, that the device to which i send my message needs the 6 Byte Data in one piece. Do you know any other possibility to send the string ( for examle 0501 44880000 ) in one piece to my device an particularly to recieve this string in the same form as I send it? ( in the example 05 is a channel type, 01 is a channel number and 44880000 is the Hex value for the float value 4,25 ). The recieving device needs the complete information in ONE 6 Byte message.

Thank you 

0 Kudos
Message 5 of 10
(2,931 Views)

I don't see the problem  Smiley Surprised   You send a string with one send command. 

Have a look at this. http://forums.ni.com/ni/board/message?board.id=140&message.id=17616&jump=true

Try my VI COM port.vi (several LV versions there) Make sure you know how to terminate (or not) the command to your device.

Sorry mixed up some post, You are the CAN guy  Smiley Very Happy

Get back to you

Message Edited by K C on 06-19-2006 01:39 PM

0 Kudos
Message 6 of 10
(2,927 Views)

Your CAN VI is expecting the data in a 1D array (DBL) If you convert your ASCII data into an byte array you can wire this to your CAN vi data input.

If I look at the CAN VI i think it should work.

If it's not working can you tell me what CAN VI's you are using or can you post a VI with your (basic) program ?

0 Kudos
Message 7 of 10
(2,924 Views)
Hi KC.
 
I have tested many things yesterday and today in the morning but my VI doesn´t work how I want it to.
I attached the two VI´s for sending and recieving. So if you have time, you can have a look at it.

Thanks
Download All
0 Kudos
Message 8 of 10
(2,916 Views)

Hi,

I am afraid that I put you on the wrong track.

Take a look at this VI (LV8) You convert ASCII characters to a byte array. A ASCII '0' (Zero) is in hex 0x30 is decimal 48

You should set your ASCII constant in HEX mode in this way a zero is a 'real' zero.

You can answer in German if you like I can read that. Mein schreiben in Deutsch a;sojfioehrgo;hg  Smiley Very Happy.

 

0 Kudos
Message 9 of 10
(2,909 Views)

Hi.

I will have a look at your VI soon. I´d like to answer you in english because it´s a good training for me Smiley Happy

0 Kudos
Message 10 of 10
(2,906 Views)