Author Topic: I7017  (Read 13016 times)

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
I7017
« 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

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:I7017
« Reply #1 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.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:I7017
« Reply #2 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:
  • Crank up the BAUD rate. If you could run at 115200 BAUD, then your 62 character command/response will take about 5.2ms instead of 62ms.
  • You could change the response format to 2's complement HEX.  This would shorten the response string for the #AA from 58 characters to 34.  The total command/response string length is now 38 characters. At 115200 BAUD this will require about 3.1ms.
  • If you are only interested in a single A/D channel, then you could use #AAN format to read only a single A/D channel.  The command grows to 5 characters but the response is only 5 characters (2's Compliment HEX) so the total command/ response is 10 characters and this would take about 0.8 ms at 115200.  I don't think that this will work for you as you appear to be looking at 3 A/D inputs for your application.  It is faster to issue a single #AA command and then to issue 3 #AAN commands.

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

Gary D.
« Last Edit: April 08, 2014, 12:49:46 PM by garysdickinson »