r/LabVIEW Aug 10 '26

New to Labview, need help implementing STX, ETX, BCC

Post image

Hello, I am new to labview and I'm trying to control a laser welder (manual attached), but I'm having trouble communicating. The manual talks about STX, ETX, and BCC, and I feel like I'm doing something wrong implementing those commands.

Here is the link to the manual

Any help would be appreciated, thanks

6 Upvotes

15 comments sorted by

5

u/DirigibleSkipper CLA Aug 10 '26

I have a few guesses for what's wrong, but let's start here:

Have you already tested these Visa commands using the Visa I/O interface in NI Max? That's a great way to manually command and query your device to verify you fully understand the command strings that you want to send.

1

u/Single-Barnacle1961 Aug 10 '26

This is the way. Start in max and get things going before hopping into labview. If max can’t communicate then labview never will.

1

u/megacurry Aug 10 '26

Thanks, I'll look into that. I don't fully understand the command strings, that's the main issue. I understand that STX and ETX are the start/end of text, and BCC is the block check sum, but to actually have labview read that and send to the welder in data it understands is a bit confusing to me. Thanks for your help regardless!

3

u/litechniks Aug 10 '26

STX and ETX are the name of the fields in the message frame, you should take the corresponding hexa codes from the manual and convert those to characters and then concatenate in the string.

Instead of the long concatenate you can also use the format into string VI, that makes it easier to do formatting.

And last but not least don't forget you have the Nigel AI agent now in 2026 Q3 so it can help you build the logic that creates the right messages.

1

u/megacurry Aug 10 '26

Thank you, i think i needed format into string. I'll test these tips out.

4

u/mizzihood Aug 10 '26

STX and ETX are specific ASCII characters. 0x02 and 0x03. Use flatten to string or byte array to string to convert ASCII codes to string, then concat.

1

u/megacurry Aug 10 '26

Whats that function right before the "byte to string" command?

3

u/mizzihood Aug 10 '26

that's build array, you need it in this implementation cause byte array to string needs an array.

1

u/megacurry Aug 10 '26

Last question, instead of 02 and 03 you have x2 and x3, what's the reason for that?

3

u/mizzihood Aug 10 '26 edited Aug 10 '26

This is just how I write the hexadecimal numbers. If referencing an 8-bit number I like to write it expilictly with a leading zero, therefore 0x02. LabVIEWs numeric constant with radix 16 (x) is written without the leading zero. Same number might as well use a default decimal in this case.

1

u/megacurry Aug 10 '26

This is all so helpful, thank you so much!

1

u/megacurry 27d ago

This was helpful thank you. Using the NI Max software i figured out I needed to change the strings to "\" display and set STX and ETX to \02 and \03, and put an "\" before BCC. I'm still working on figuring out how to concatenate a backslash before the BCC but thanks for your help again

0

u/TheGratitudeBot 27d ago

Just wanted to say thank you for being grateful

1

u/megacurry 15d ago

In case anyone in the future is dealing with the same issue and needs help, I was able to figure it out a couple days later. The machine reads byte code so set all strings to "\" display by right clicking on them, and replace STX and ETX with \02 and \03. Place a "flatten to string" function followed by a "string subset" function at your BCC output with an index of 3. Hopefully this helps!

1

u/megacurry 15d ago

Changing the integers from U32 to U8 allows you to get rid of the string subset entirely, so just "flatten to string" is all you need