Showing results 1 to 4 of 4

Thread: Send Value to hardware

  1. #1
    anahita Gast

    Default Send Value to hardware

    how can i send value to hardware in vba with out using function send value to hardware or command
    thisProject.Variables.Item("xxxx").Value = 0 is not usefull in this case?

  2. #2

    Default Re: Send Value to hardware


    If you can set a value using a send value to hardware function to the variable, you should also be able to write the variable in a VBA macro, using the exact line of code you suggested.

    To verify if your variable exists (to make sure you haven't made a spelling mistake, or that the variable in the meantime has been renamed, you can check prior to writing the value if the variable is available:

    Sub setvar()
    Dim myVar As Variable
    Set myVar = thisProject.Variables.Item("param_kg")
        If Not myVar Is Nothing Then
            myVar.Value = 23
        End If
    End Sub

  3. #3
    anahita Gast

    Default Re: Send Value to hardware

    thank you so much for you guidance
    you mean by changing the value of variable ,the new value will send to the RTU constantly?
    i thought with this way just can change the value of variable and to send the value to hardware we just can use send variable to hardware function

  4. #4

    Default Re: Send Value to hardware


    The value is only send to the hardware once, either when the VBA macro is executed, or when the "send value to hardware" function is executed.

    In zenon, the driver does not constantly send the same value to the PLC, over and over again.

Similar Threads

  1. send file to printer
    By gralex in forum VBA
    Replies: 5
    Last Post: 23rd July 2009, 07:25
  2. Send To Hardware in 6.22
    By madphilly in forum VBA
    Replies: 4
    Last Post: 22nd September 2008, 15:06
  3. send value to hardware
    By dak2483 in forum Drivers
    Replies: 7
    Last Post: 19th September 2008, 16:33
  4. Replies: 0
    Last Post: 27th September 2007, 13:17

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts