Re: binaryDecode with variable number of parameters

2012-02-20 Thread Mark Schonewille
Hi Len, My code was just an example. Words can only refer to "real" words indeed, but I believe you have already figured out how to reference the parameters. Just replace that part of my code with whatever you deem right. Perhaps something like "repeat with x = 1 to number of chars step 2". --

Re: binaryDecode with variable number of parameters

2012-02-19 Thread Mark Wieder
Len- Sunday, February 19, 2012, 8:09:11 PM, you wrote: > As it turns out, there are only two function codes I have to worry about > (i.e., ones we actually use): FC 3 - Read multiple registers, and FC 16 > - write multiple registers. FC3 is easy (on the way in) because it has > a fixed length.

Re: binaryDecode with variable number of parameters

2012-02-19 Thread Len Morgan
On 2/19/2012 9:05 PM, Mark Wieder wrote: Len- Sunday, February 19, 2012, 5:23:11 PM, you wrote: Related to my problem with reading binary data from a socket, how do I handle a variable number of numbers that will come in with binaryDecode? To explain, I get a number in the packet header that

Re: binaryDecode with variable number of parameters

2012-02-19 Thread Mark Wieder
Len- Sunday, February 19, 2012, 5:23:11 PM, you wrote: > Related to my problem with reading binary data from a socket, how do I > handle a variable number of numbers that will come in with binaryDecode? >>> To explain, I get a number in the packet header that tells me there are >>> x number of

Re: binaryDecode with variable number of parameters

2012-02-19 Thread Len Morgan
Hi Mark, It looks like that's what I'm going to have to do. In looking at your code though, the "word x" part (where the binary data is) won't that only work on "real" words that have spaces between them? This is actually a chunk of binary data where I'm using "word" in the sense of 2 8 bit

Re: binaryDecode with variable number of parameters

2012-02-19 Thread Mark Schonewille
Hi Len, You could use a repeat loop, similar to repeat with x = 1 to myNrOfWords get binaryDecode("h*",word x of myData,myTempVar) put myTempVar into myArray[x] end repeat -- Kind regards, Mark Schonewille Economy-x-Talk Http://economy-x-talk.com Share the clipboard of your computer over a

Re: binaryDecode with variable number of parameters

2012-02-19 Thread Len Morgan
Related to my problem with reading binary data from a socket, how do I handle a variable number of numbers that will come in with binaryDecode? To explain, I get a number in the packet header that tells me there are x number of bytes to follow in this packet. I know the first byte is a remote

Re: binaryDecode with variable number of parameters

2012-02-19 Thread Mark Wieder
Len- Sunday, February 19, 2012, 4:08:24 PM, you wrote: > Related to my problem with reading binary data from a socket, how do I > handle a variable number of numbers that will come in with binaryDecode? > To explain, I get a number in the packet header that tells me there are > x number of bytes

binaryDecode with variable number of parameters

2012-02-19 Thread Len Morgan
Related to my problem with reading binary data from a socket, how do I handle a variable number of numbers that will come in with binaryDecode? To explain, I get a number in the packet header that tells me there are x number of bytes to follow in this packet. I know the first byte is a remote