Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending hex values

Hey guys,

 

short question, i guess the answer is even shorter... a yes or no and iam fine

 

To make my point clear, a simple example:

 

Imagine, you have a frame within a database. The Frame includes a number of signals which are also completly adressed fine in the database. The Information of frame, singals and values (in hex) are provided by a CAN specification of a 3rd Party device.

 

Now i want to write the hex values into the singals respective frame. By using the NI-CAN API.

 

As the Frame and the Signals are adressed properly i just need to know, how to send the hex values into the Send singal API.

 

Or is it that simple, that i just create a numeric control with lets say hex display mode and wire the control to the singal input of the Send Singal API? As there is no Conversion of Datatype (Typecast) just a other way of displaying the data this should be enough?

 

Iam just asking in this way, because i want to create the database in advance and havent got the 3rd party device yet.

 

Thanks much in advance

 

cheers chris

0 Kudos
Message 1 of 4
(4,833 Views)

Hex is just a way of representing data.  To be clear it makes no difference if the display shows 0x0A or decimal 10.  It is just a number and those numbers are the same.  So if you have a database, and it has a signal defined as taking up the first byte, and having a range of 0 to 255 (decimal).  Then when you write that signal you will provide a value between 0 and 255.  The data type will actually be a double because that's how XNET works.

 

If you want the control to be a U8 then that's fine too, just wire it's value to the write value, which is normally a double.  It will coerce but that's fine because the range of a U8 is what you actually want.

 

If you get confused post and example of what you are talking about.

0 Kudos
Message 2 of 4
(4,830 Views)

Thanks much for your fast reply,

 

no further explanation needed, this was the answer i was expecting...  i just use NI-CAN API but, i guess iam still fine. Maybe u can help me out on another question on NI-CAN API not XNET (i would be glad to use it xnet, but we use some of the old fashioned pci cards...)

 

How is the behaviour of a frame when i change one of its values?

 

Lets say, if i have frame. iam sending this frame continously to my NI-CAN pci car. In this frame is one signal. The signals standard value is 0. Now i change the signals value to 1 by using CAN write. I guess the signal within the frame, which is sent continously, now stays on the value 1. It stays 1 unless i change its value, by using CAN write again. Or i close the session and restart it without specifining any value?

 

Thanks again

 

cheers chris 

0 Kudos
Message 3 of 4
(4,827 Views)

XNET supports 3 different ways to write a CAN frame, 3 different ways to write CAN signals.  You need to read the documentation to understand which of the 6 methods of putting data on the bus is right for your sitation.  Installed with XNET is context help explaining each of these and when one might be desired over the other.  I see very few cases where XNET doesn't meet the needs of a system.  It just might take some time to understand how it needs to work.

0 Kudos
Message 4 of 4
(4,818 Views)