-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary encoding of larger data types in <ARBITRARY BLOCK PROGRAM DATA> #52
Comments
Just some thoughts, instead of appending the type to the function name, the type could be provided as an argument. If the type endianness is the same as the platform, then only the length is checked to be type size aligned, otherwise swapping is also provided. There are libraries available for swapping, but it is actually trivial the only advantage from a library would be it SIMD instructions could be used. |
It is also possible to have one function and parameter as type as you propose. It can look like your implementation of processing of array/buffer of numbers. But this will be better to have separate functions. This is straightforward This will consume all following parameters or only one arbitrary block with swapped UInt16 values. This will consume only one arbitrary block of NORMAL (big-endian) 64bit integers, no ASCII encoding allowed. For me, it sounds better We can also officially divide |
I have introduced first support in 3b99af6 for returning arrays. It is still not well tested, it is not optimal but it is first step. I would like to introduce also reading array parameters and also unit tests for all new functions. |
Result functions are now ready. They are also covered by tests. |
Array parameters are prepared but currently support only text. |
It would be nice to support arrays of larger types in arbitrary block.
Currently, there is only one function for parameter
SCPI_ParamArbitraryBlock()
and one for resultSCPI_ResultArbitraryBlock()
It is sometimes needed to transfer larger data types e.g. array of 32bit integers, but endiannes is up to the user of the library.
This problem was partially discussed in #51
Possible solutions
SCPI_ParamArbitraryBlockXYZ
functions to do this on the fly but this will probably need additional data bufferSpecification
In the SCPI specification, there are two main chapters about binary encoding of these types
SCPI-99:Volume 1 - 9.1 [:DATA] <type>[,<length>]
SCPI-99:Volume 3 - 6.4.2 FORMat
Among others, there are two types of encoding "normal" and "swapped". It seems that "normal" is big-endian representation and "swapped" is little-endian.
The text was updated successfully, but these errors were encountered: