What is Matlab readcommand to read digital inputs in ssc32

I understand from the Users guide that, to read digital inputs, we simply give "A B C D "
But what is the serial command to be used ?
If i just enter A B . It gives an error “Unknown variable A or B”
Tried most of the serial port read commands,like
fread
fget
fgetl
fscanf.
Nothing works. Still getting the same error. It does not identify A or B or C or D inputs in the ssc32.

Please help :frowning:

Below are the commands for getting inputs fron the ssc-32. The analog input pins come with jumpers that will return 0 or 255 for the ground and 5v pins they are connected to. If you are using a windows machine, you can use the bottom lynxterm application to do your initial input testing and compare that to your matlab efforts. Remember all querys and commands must be ended with a carrage return.

lynxmotion.com/images/html/b … tm#readdin

lynxmotion.com/p-567-free-do … xterm.aspx

Thank you, that application was helpful. now i know my ssc32 is working right.
I’ll try my commands again :slight_smile:

fprintf( s,’#1P’ num2str(2000) ‘T1000’]); is the syntax in matlab to send the input to motor.
What is the syntax to get the output from digital pin A or B or C or D
It should be something like
fscanf(s,[A] ) or something???

You need to send the command to read the digital input from one or more of the pins, which is done something like (I don’t know Matlab, so I am guessing based on context): fprintf(s,‘A’]); Then, the SSC-32 will send back the value, which you read with the **fscanf **function.

Read about it in the manual at this link; it is in the SSC-32 Manual, in the section titled “Read Digital Inputs”