LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex String to Remote TCPIP Server

Solved!
Go to solution

Hi.

I am in the final stages of a project. The aim is to take a GPRMC ASCII string from my GPS enabled radio, convert it to HEX and send to my remote GPS tracking server.

The remote server is from a third party and only accepts HEX. I am new to LabView but have successfully got to the stage of converting the string to HEX. Please find below an example

 

HEX:

32302C3031303930373030303030302C31332C30322C31382C31362E3831363636372C39362E3136363636372C313330362C532C002A32380D0A0D0A

 

ASCII:

20,010907000000,13,02,18,16.816667,96.166667,1306,S,28

 

I have spent the last few days trawling the internet and support forums but have not been able to find (and not sure if its possible) how to send the HEX over a TCPIP: PORT  connection. If anyone could kindly point me in the right direction while I still have hair left it would be greatly appreciated.

 

Regards

Dave

 

0 Kudos
Message 1 of 12
(4,137 Views)

Hi Dave,

 

how to send the HEX over a TCPIP: PORT  connection.

TCP functions accept strings for data input.

I guess your "HEX" data also is a plain string?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(4,105 Views)

Hi GerdW.

 

Yes the HEX is currently a plain string.

Regards

Dave

0 Kudos
Message 3 of 12
(4,102 Views)

When you say "hex", what exactly do you mean?

 

If you are just referring to the raw data, then it sounds like you are just a little confused by the display on the indicator.  For example, an ASCII "2" is represented by a byte with a value of 0x32.  So your data is the same at the byte level.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 12
(4,082 Views)

Hi Crossrulz

I am taking an "Array To Spreadsheet String" and passing it through a "Number to Hexadecimal String"

 

Output of "Array to SpreadSheet String" =

20,010907000000,13,02,18,16.816667,96.166667,1306,S,28

 

Output of "Number to Hexadecimal String" =

32302C3031303930373030303030302C31332C30322C31382C31362E3831363636372C39362E3136363636372C313330362C532C002A32380D0A0D0A

 

I hope this helps some. I ave only been using LabVIEW for about a week.

 

Regards Dave

 

0 Kudos
Message 5 of 12
(4,076 Views)

Hi Dave,

 

I am taking an "Array To Spreadsheet String" and passing it through a "Number to Hexadecimal String"

Output of "Array to SpreadSheet String" =20,010907000000,13,02,18,16.816667,96.166667,1306,S,28

Output of "Number to Hexadecimal String" =32302C3031303930373030303030302C31332C30…

ArrayToSpreadsheetString outputs a string, NumberToHexString expects a numeric value at its input.

How did you connect those two functions???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(4,074 Views)

Hi GerdW

The project has been a learning process and fun but have probably scurried up a number of wrong paths. However the end result appears to be near my goal. Happy for direction change if needed.

 

I used the following jpg to convert the CSV to HEX (If my terms are correct).

 

 Regards

Dave

0 Kudos
Message 7 of 12
(4,070 Views)

Hi Dave,

 

I used the following jpg to convert the CSV to HEX (If my terms are correct).

So you used some more function than you have described earlier.

See the effect of providing more information?

 

Some changes to your code:

check.png

(You really should learn to clean up your block diagrams!)

 

So is your problem solved?

Is your GPS tracker receiving the data it needs/expects?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(4,067 Views)

Noted on the tidy up. It is my plan once I have finished the continuous changes to make it good.

 

I now need to send that information over a TCP connection to my GPS server located offshore. This is my final headache.

0 Kudos
Message 9 of 12
(4,063 Views)
Solution
Accepted by topic author DaveVoigts

Hi Dave,

 

looks quite easy:

check.png

(LabVIEW comes with a huge library of example VIs. There are also examples for those TCP functions…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 12
(4,060 Views)