int to 4 byte string - sysmac

benmols

Member
Join Date
Oct 2019
Location
Edi
Posts
2
Hey all, I'm struggling with the following in Sysmac right now. Any help would greatly appreciated.

I am dealing with socket comm strings, a first for me, but it is working nicely in sysmac.

When I am sending a message the client is expecting the first string to show the length, but they are expecting to see it like this: If the message length is 34 they want the string to be preceded by a 4byte string such as this:00000000 00000000 00000011 00000100

Now I can easily get the length of a string and get that into an integer. But I can not figure out how to get that integer into a 4 byte string.

Is it possible with the functions in sysmac studio?

Hope I have given enough information, thanks
 

Similar Topics

Hello All! I am having difficulties mapping register values. In the TURCK register there are 24 unique register bytes corresponding to different...
Replies
2
Views
2,569
Hi All I have recently had cause to start using Unity Pro but am still struggling with it a bit. I a trying to convert a speed reference for a...
Replies
5
Views
3,507
Hi This may be a stupid question but in Step 7 is it possible to convert a byte to a Double Integer eg convert DB*.DBB* to DB*.DBD* Your...
Replies
12
Views
9,631
I have a line of code that gets the current D/T and places it into a DB as 8 Bytes. My problem is I compare that to see if a particular hour and...
Replies
4
Views
8,004
Has anybody got a routine handy that will take an INT as input (1 - 21) and convert it to the Byte.Bit format that is needed to add to a basic...
Replies
14
Views
21,269
Back
Top Bottom