How to avoid HEX UDP input conversion

Christie Widget Designer Version 6 - Q&A

Moderator: Moderator Group

Forum rules
When asking make sure to include the operating system and the revision of Widget Designer you are using.

How to avoid HEX UDP input conversion

Postby ljherbers » Tue Mar 09, 2021 12:50 pm

Hey everyone,

I'm using WD 6.5.1 under Win10 and am trying to communicate with a camera via UDP and HEX commands. Sending them out works fine, but I'm stuck on how WD handles the camera's response. How do I set everything up to be able to write the HEX response into a variable without any steps of conversion? I'm using the UDP Input node so far, but ASCII of course obliterates the HEX string and I don't see how I could use Bytes instead either. Is there a way to solve this?
ljherbers
 
Posts: 2
Joined: Wed May 17, 2017 2:29 pm

Re: How to avoid HEX UDP input conversion

Postby Janina Baltaziewicz » Fri Apr 09, 2021 12:14 pm

Hi,

The general problem you are facing is that WD does not really provide the means to work with native HEX values.
This means that you must find your own way to translate incoming messages from ASCII or Decimals (bytes) to HEX.

The easiest approach would be to create a simple look-up-table, which returns the HEX equivalent of each byte value.
You can use for example a ListView, or a list variable.
Next, I would recommend using an Action Script node to receive the message and instantly encode it to a list of byte values:
https://christiepandorasbox.com/root/do ... script.htm (see Example 2)
You can then run a for loop over each list element and replace it with the HEX value you read from your LUT.
Depending on what you want to do with the HEX values, you can also concatenate them into one String variable.

Does this help you?
Janina Baltaziewicz
Customer Service Engineer
User avatar
Janina Baltaziewicz
 
Posts: 53
Joined: Tue Jun 14, 2016 2:08 pm


Return to Widget Designer V6

Who is online

Users browsing this forum: No registered users and 16 guests

cron