Author Topic: Newbie Question  (Read 2637 times)

daakers

  • Newbie
  • *
  • Posts: 9
    • View Profile
Newbie Question
« on: September 25, 2016, 05:49:18 PM »
Liking this software so far. I have a simple question. What is the best way to read a SINGLE BIT in to a variable and not an object??

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Newbie Question
« Reply #1 on: September 25, 2016, 05:52:16 PM »
What driver are you using?

daakers

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Newbie Question
« Reply #2 on: September 25, 2016, 05:53:59 PM »
Modbus TCP

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Newbie Question
« Reply #3 on: September 25, 2016, 06:10:35 PM »
Dim MyValue as string
MyValue=ModbusTCPCom1.Read("10001")

daakers

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Newbie Question
« Reply #4 on: September 25, 2016, 06:15:11 PM »
Thanks. I'm too use to off the shelf HMIs and don't have very much time with VB, but I'm learning.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Newbie Question
« Reply #5 on: September 25, 2016, 06:36:54 PM »
Within all of the controls you should be able to do just about all of the same things without having to write code.

daakers

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Newbie Question
« Reply #6 on: September 25, 2016, 06:48:23 PM »
I was having a hard time changing text on the Basic Button depending on On/Off status. This made it easy or more like I know?? I was trying to change the text if the HighLight bit was on or off.
Maybe even an easier way but this works. Thanks for all the hep. I have used everything from Wonderware, Infilink, CX Supervisor, Indusoft, NI Lookout, but I'm liking this. Working on a water control system for jail showers and toilets LOL. 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Newbie Question
« Reply #7 on: September 25, 2016, 07:07:58 PM »
The BasicButton has a PLCAddressSelectTextAlternate that is used to change the text based on a Boolean value. You can put the same address as you have in PLCAddressHighlight, then set the TextAlternate property to the text you want to show when the bit is true.

daakers

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Newbie Question
« Reply #8 on: September 25, 2016, 08:30:40 PM »
Thanks, I will try that. How to do a Write to a address? I'm slow but will pick up. I'm doing a shower water on between x time to y time, got that working but need to write a bit to the plc during this time. How do you put up with us newbies???

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Newbie Question
« Reply #9 on: September 25, 2016, 08:42:58 PM »
Several controls have a PLCAddressKeypad property. If a valid address is in that property, when the control is clicked, a keypad will popup to enter a value.

There is also a new control named KeypadInput. It is basically a TextBox that will write a value to the PLC when an enter key is pressed. This allows it to work with keyboard wedge barcode scanners.