Internet PLC Forum

General => Technical support => Topic started by: can on April 08, 2014, 01:47:50 AM

Title: I7017
Post by: can on April 08, 2014, 01:47:50 AM
Hi. I am using FMD88 and I7017. LVDT probes are connected to a servo motor that will retract upon probe contact with a surface. I want to capture the maximum compression of the probes. I tried using the below custom function executed in 0.01s loop. Data can be captured sometimes only. Is the function too slow? Any way to solve the problem?

Z$ = NETCMD$(3,"#01"+CHR$(13)+"~")

FOR I = 0 to 3
   DM[11+I] = VAL(MID$(Z$,2+I*7,3)+MID$(Z$,6+I*7,3))  'Get the digits without the decimal point
   If DM[11+I] < DM[21+I]
   dm[21+I] = DM[11+I]
   endif
NEXT
Title: Re:I7017
Post by: support on April 08, 2014, 10:23:54 AM
Note that the I-7017 has a maximum operating frequency of 10Hz so you may be trying to sample the input faster than the analog input is able to capture the changes.
Title: Re:I7017
Post by: garysdickinson on April 08, 2014, 12:45:31 PM
Another thing to consider is the BAUD rate.  The default BAUD rate for the I7017 is 9600.  

At 9600 each character requires approximately 1ms to transmit/receive.  For your example the, command sent to the I7017 is 4 characters in length, this will require about 4ms to transmit the command.

The response for the #AA command is quite long, this is what it looks like:
  ">+05.123+04.153+07.234-02.356+10.000-05.133+02.345+08.234" and is followed by an ASCII CR.

The response is 58 characters in length.  This will require about 58ms to receive.

The command and response will take about 62ms. This does not take into account the internal processing time of the I7017.

It is not possible to get an ADC reading every 10ms (0.01SecClk) if your communication takes 62ms.

I have 3 suggestions to speed up stuff:

I have more suggestions, but I'll save them until you've digested, these.

Gary D.