+6

Convert Machine ID to numbers?

Michael Carlyle 5 years ago in IQANdesign updated by A.DOMS 5 months ago 4

Is there an easy way to convert the machine ID (which I believe is a text variable) into numbers (each character or the whole number woudl work) as we use this as machine serial # and need to change parameters based on certain digits.

No, there is no string conversion function available in the existing versions. It is one function I hope we could introduce in a future version, it would be quite useful.

One workaround I have suggested for a similar usage in another application was to also use an Integer Parameter and set that to the same value as the machine ID (assuming that the machine ID only contains digits).

Similarly, I'd like to convert module serial number (text value type) into an integer or real value type to perform math calculations with the digits of the serial number.  Has there been any updates regarding string handling functions?

+2

Hi,

I found a way to convert a short texte into hexa.

It's working with 2 calculators.

Our calculators communicate by J1939 way, so I'm using a "J1939 text out" to send the Machine ID to the second calculator.

On this second calculator I'm receving a Hexa message corresponding to the ASCII table.

Now I could use it to send my message to an external component by CANopen, or convert it into numbers.

You have an uniq message if the texte is max 8 caracters (be carrefull to hiden space).

If the text is more than 8 caracters, the message is split in several messages, and the Byte 1 is the index order of the frames :

Mess N° Time offset CAN ID Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte 8
3) 4237.5 1CEBFF27 01 45 73 73 61 69 73 20
4) 4287.5 1CEBFF27 02 58 2D 74 65 6E 64 20
5) 4337.5 1CEBFF27 03 45 FF FF FF FF FF FF

I didn't found how to make it working with only One calculator.

Maybe someone will have a trick to do it ?

Hope this will help !

Alexis D.