LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate TCP commands in Labview?

I have a project that I'm currently working on that involves sending various messages (hexidecimal format) via TCP protocol.  I need a way to create/generate these codes in Labview.  I currently have a program that was written in VB that performs the operation needed, but I have no way of using it to interface with a DAQ board (the next step in the project).
I've tried using FOR, WHILE, and Timed Loops, but the issue I run into is incrementing the various bytes.  Example:

I need to send a command like this:  0E 00 21 06 00 00 05 00 01 42 45 54 54
And then I want to change the "01" to 02, 03, and so on up to FF.  When it reaches FF, the next step is to increment the "00" in front of it.  I've been able to get one series to work (using timed loop to create the command, then send and receive response through TCP, then check DAQ for output, then repeat, but when I reach FF, I can't get the second pair to increment as well.

Any ideas?
0 Kudos
Message 1 of 3
(3,044 Views)
How are you creating the command? Are you using an array of U8 integers? Are you always starting the increment on the "01" (i.e., the 9th value)? What happens when you increments the "00" on up to FF? Do you next increment the 05?
0 Kudos
Message 2 of 3
(3,040 Views)
Yes, you're correct...  I was building an array of U8 integers.  My first try was to use the "number to Hex string" VI, but then I ran into issues splitting the output of that VI into the 8 bit sections.  And, yes, the next step would be to increment the "05".

It seems I may have found a possible answer.  In another thread, someone was talking about calling VI's through VB.  If I can incorporate this into the VB program that's already built, I think I have the problem solved.  That's what I'm going to be attempting today.
0 Kudos
Message 3 of 3
(3,022 Views)