Trouble passing a scaller to a function

Recommended Posts


I'm having difficulty passing the correct data type to a function. I want to pass an element in an array to the LJ eput function like so:

deviceArr = {3, 7, 3, 4}

index = 2

ePut(deviceArr[deviceArr[index], ...)

when I do this I get the error:

D0050:99:3004 LabJack: ID must be a scalar value, not an array or a string: Line 6

In C device[index] would be an int or whatever the data type of the array is but this seems not to be the case in daqfactory.

How do I ensure that a scalar gets passed in?

Thanks for the help.

Link to comment
Share on other sites


1) DAQFactory only has two types: numbers (double precision float) and strings. There is no "int" or anything like C, so type casting doesn't really apply. If you need to convert from a string to a number, use the strtodouble() function, and correspondingly the other way, use doubletostr() or format().

2) Define's should probably be in a startup sequence. You don't know when a user device is going to get called.

Link to comment
Share on other sites


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