Driver Editor: ability to assign array of doubles directly to a property

Hi,
I am trying to create a Matlab(2011a) driver for a device using the Instrument Control Toolbox Driver Editor. The device accepts an X,Y coordinate as a concatenated string. I want the driver to accept an array like [23 34] directly (and internally convert to string). However the restriction on Property Values being limited to String, Double, or Boolean prevents me from doing this. Is there an undocumented way of doing this or any plans to add this feature? or am I stuck converting my array to a string before passing it to the driver? Suggestions?
Thanks for your help
Mike

Risposte (2)

What do you mean? Can mat2str() be used?
>> mat2str(magic(2))
ans =
[1 3;4 2]

3 Commenti

I am not interested in how to convert an array to a string.My question is specific to the Instrument Control Toolbox. It limits values that can be passed to just String, Double, or Boolean. I was hoping there was a way to pass in an array of numbers, instead of just a single number. It looks like I forgot to mention ICT in my description. I will update.
You indicated: "The device accepts an X,Y coordinate as a concatenated string." Okay, it sounds like you can't change the device so let's deal with it. "I want the driver to accept an array like [23 34] directly (and internally convert to string)". That is a good idea. So you can write a wrapping function, accept [23 34] directly, convert it to string and then feed to the device. That's my reading of your question. "However the restriction on Property Values being limited to String, Double, or Boolean prevents me from doing this." This is the part I don't understand.
Thanks Fangjun for your effort. This is a limitation on the Driver Editor that comes with the Instrument Control Toolbox. As it stands now I may drop using the ICT and just write the whole thing from scratch.

Accedi per commentare.

Mike,
There is no limitation on passing in an array of doubles into a MDD. The datatype is just the type - it doesn't specify the number of elements of that type.
-Vinod

Richiesto:

il 3 Nov 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by