05-02-2017 09:41 AM - edited 05-02-2017 10:03 AM
I have run into what seems like a small roadblock to using the method I marked as "solution". I made a type called "ImageData" that is really just a string. The problem is that this is treated as a normal string in teststand. Is there a way to specify a type as a binary string? I also considered not making a custom type and instead just logging the adapter parameter of type "binary string" using the PROP_IMAGE statement you described, but under "types to log" there is no option for binary string, or string for that matter.
EDIT: TestStand seems to be passing the string along just fine. I can pass it via input parameter to a LabVIEW VI and it makes it into the VI just fine. When I log it to the database using TestStand however, it comes in as 0x0000 always.
Thanks,
05-02-2017 10:48 AM
So, I am able to get "something" stored into PROP_BINARY using the PROP_IMAGE statement. It is no longer "0x0000" The trick seemed to be either keeping "0" as the "Size (In Bytes) which requires leaving "Format" blank or specifying something large in "Size (In Bytes)" and then selecting something for "Format". Interestingly, no matter what format I choose the value stored in the database is always the same. However, the value stored in the database using the TestStand schema does not match the value stored in the database manually using LabVIEW. I still cannot convert back into an image when using the value stored by TestStand. When I manually store the image data using LabVIEW I can convert it back into image no problem.
05-02-2017 02:54 PM
So, I have done some reading and it seems TestStand encodes/compresses binary strings? Is it possible to trick TestStand into not doing this?
I tried using [String].SetValBinary("",[String].GetValBinary("",0)) without success.
05-03-2017 01:33 PM
For anyone else who comes across this issue and wants to store images in a database see the related thread linked below:
http://forums.ni.com/t5/NI-TestStand/Binary-String-to-Database/m-p/3622183#M54455
Scott_Richardson's solution got me allllmost there. The last bit I was missing was how to store the data in a format that I could read back in LabVIEW. The thread I linked to expands on that part of the issue and offers a solution. HINT: Don't store it as a binary string, store it as a byte array.