Author Topic: Using VB6 to interrorgate Analog inputs  (Read 14695 times)

Fernandz

  • Newbie
  • Posts: 10
    • View Profile
Using VB6 to interrorgate Analog inputs
« on: September 04, 2003, 04:16:28 PM »
Is there a list of commands that can be used to return the values of the Analog inputs of the M-series PLC? I would like to use the MScomm control to link to the serial port.
« Last Edit: December 31, 1969, 04:00:09 PM by -1 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Using VB6 to interrorgate Analog inputs
« Reply #1 on: September 04, 2003, 07:20:26 PM »
The M-series PLC does not automatically queries the ADC ports unless you program it specifically to do so. So in order read an ADC value from AD input #n, you need to execute the ADC(n) function periodically to retrieve the readings. That can be easily achieved using a clock pulse and execute the ADC(n) function periodicaly.

Once the ADC(n) function is executed, you can then use the "RVS0Bnn" command to read the ADC data from its internal registers. Alternatively, if you have read the values into DM
  • variable by executing e.g.


  DM[10] = ADC(1)

then you can use the host link command "RVDxxxx" to read the value from the DM.

We have a sample VB6 program that you can download from our website to assist you in writing your comm routine with work with the PLC, as follow:

http://www.tri-plc.com/applications/VBsample.htm

« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Fernandz

  • Newbie
  • Posts: 10
    • View Profile
Re: Using VB6 to interrorgate Analog inputs
« Reply #2 on: September 05, 2003, 05:22:21 PM »
Thanks.......I skipped over chapter 4 in the User Manual my fault. ;D Now i understand the command/response format
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »