Author Topic: Data Base Decision  (Read 1019 times)

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Data Base Decision
« on: February 01, 2018, 08:22:47 AM »
Good Morning,  I have a question about writing a value back to the PLC from code, I have a Data Base returning an Integer back to the VB and need to pass that on to the PLC.  What would be the best way to use the code to write it to the PLC?

Larry

jazzplayermark

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Data Base Decision
« Reply #1 on: February 01, 2018, 10:02:26 AM »
What type PLC and what is the address you want to write to?

You could do something like :
 mydriver.myplc.Write("N7:100", valuefromdatabase)

This would be for Allen bradley slc/micrologix

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Data Base Decision
« Reply #2 on: February 01, 2018, 11:29:16 AM »

jazzplayermark

This one is an AutomationDirect P2-550. I am using the modbusTCP driver, and its working very fast and well. Thanks for the point of a direct call to the driver.  " Modbus51.Write("00001", True)" works very well for the bits.

Thanks again.   Larry

Unwritter

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Data Base Decision
« Reply #3 on: February 21, 2018, 11:35:13 PM »
The most important part of this content is more and more, and I can recommend the knowledge so that I can publish it for future use.