http command

Tagged: 

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #13486
    kjakan
    Participant

    Hi!

    Is it possible to send a http command to a plc? In the style of:

    http://remote:remote@IP/scada-remote?m=json&r=grp&fn=write&alias=34/1/2&value=1

    Thnks for fantastic software!

    #13487
    manjey73
    Participant

    Try to figure out the DrvHttpNotif driver, maybe it will solve your problem when sending an arbitrary command

    #13488
    kjakan
    Participant

    Thanks! Seems to be the right direction, but haven’t figured out how to use it yet.

    example: http://remote:remote@http://192.68.1.23//scada-remote?m=json&r=grp&fn=write&alias={grp}&value={value}

    Generated three channels of this device, requests, notifications and response status..

    I guess there is a way to pass the parameteres GRP and VALUE through the formula field of the request channel? Or maybe I miss something substantial in the process? Will try more tomorrow…

    #13489
    manjey73
    Participant

    If you need to send and receive some value, it may not be suitable. Or make different queries for a certain number of values.
    To be honest, I have not used this driver for such a task. I made my own based on this driver for solving my specific task.

    But it seems that this is the only driver for working with http as part of Scada

    #13494
    Mikhail
    Moderator

    Hi,
    With DrvHttpNotif you can send any parameters using GET or POST request.
    You should send a command having the code Request and text like
    grp=value1
    value=value2

    #13495
    Mikhail
    Moderator

    First of all, try sending command from the device data page (in Communicator settings). Provide screenshots if it doesn’t work.

    #13498
    kjakan
    Participant

    Shure it works if done right..But’s that obviously not what I’m doing 😉

    1

    headers page is blank
    content page is blank

    2

    gets error..

    In a webbrowser from same computer this works:
    http://remote:Hovdetjenn18@10.147.19.135/scada-remote?m=json&r=grp&fn=write&alias=63/7/200&value=34

    • This reply was modified 1 year, 10 months ago by kjakan.
    #13500
    Mikhail
    Moderator

    Thank you.
    Could you also provide a screenshot of the communication line log when you send a command?

    #13507
    kjakan
    Participant

    log

    #13510
    Mikhail
    Moderator

    I will check.

    #13513
    Mikhail
    Moderator

    Cannot reproduce: https://ibb.co/S0sW3Tm

    My DrvHttpNotif_XXX.xml is

    <?xml version="1.0" encoding="utf-8"?>
    <NotifDeviceConfig>
      <Uri>http://remote:Hovdetjenn18@10.147.19.135/scada-remote?m=json&amp;r=grp&amp;fn=write&amp;alias={grp}&amp;value={value}</Uri>
      <Method>Get</Method>
      <Headers />
      <Content />
      <ContentType />
      <ContentEscaping>None</ContentEscaping>
      <ParamEnabled>true</ParamEnabled>
      <ParamBegin>{</ParamBegin>
      <ParamEnd>}</ParamEnd>
      <AddrSep>;</AddrSep>
    </NotifDeviceConfig>
    

    Command string data:

    value=34
    grp=63/7/200
    
    • This reply was modified 1 year, 10 months ago by Mikhail.
    #13515
    Mikhail
    Moderator

    Try simplifying the request and arguments to find the error cause.

    #13516
    Mikhail
    Moderator

    Check the device timeout. It should be > 0.

    #13517
    kjakan
    Participant

    Thanks! Device timeout=0 was the error!

    #13518
    kjakan
    Participant

    And the username/password had to be given via headers:

    Name: Authorization
    Value: Basic //Base64 encoded username:password//

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.