To.Ulong Bug????

Recommended Posts

  • 2 weeks later...

Actually, I wrote the user guide, so I can assure you I have read it many times. No where does it say that you can use variables inside of {} notation. Only constants are allowed:





On page 44 of the users guide it says exactly this:

Only numbers and commas are allowed between the {}, but these numbers can be in hex or binary format using the appropriate delimiter described a little later.

What you want is simply this:


because c contains the whole array already.

Link to comment
Share on other sites

I think you are misunderstanding. Only constants are allowed inside the {} notation. This is identical to C / C++ (except C has #defines, which DAQFactory does not). In the To.ULong() function you can use variables all you want. The primary use is for parsing serial data. So, if you were reading 4 bytes from the serial port into a string that specify an unsigned 32 bit value, you could do:

private string datain = // read 4 bytes

private val = to.Ulong(asca(datain))

The asca() function converts a string into an array of bytes. So, asca("abcd") returns {97,98,99,100}.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.