Forum Home › Forums › Communicating with Devices › http command
Tagged: http command
- This topic has 15 replies, 3 voices, and was last updated 1 year, 10 months ago by
Mikhail.
-
AuthorPosts
-
October 11, 2023 at 4:21 pm #13486
kjakan
ParticipantHi!
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!
October 11, 2023 at 6:43 pm #13487manjey73
ParticipantTry to figure out the DrvHttpNotif driver, maybe it will solve your problem when sending an arbitrary command
October 11, 2023 at 9:08 pm #13488kjakan
ParticipantThanks! 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…
October 12, 2023 at 7:04 am #13489manjey73
ParticipantIf 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
October 12, 2023 at 1:23 pm #13494Mikhail
ModeratorHi,
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=value2October 12, 2023 at 1:25 pm #13495Mikhail
ModeratorFirst of all, try sending command from the device data page (in Communicator settings). Provide screenshots if it doesn’t work.
October 12, 2023 at 4:34 pm #13498kjakan
ParticipantShure it works if done right..But’s that obviously not what I’m doing 😉
headers page is blank
content page is blankgets 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.
October 13, 2023 at 11:02 am #13500Mikhail
ModeratorThank you.
Could you also provide a screenshot of the communication line log when you send a command?October 15, 2023 at 12:52 pm #13507kjakan
ParticipantOctober 16, 2023 at 9:00 am #13510Mikhail
ModeratorI will check.
October 16, 2023 at 1:20 pm #13513Mikhail
ModeratorCannot 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&r=grp&fn=write&alias={grp}&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.
October 16, 2023 at 1:25 pm #13515Mikhail
ModeratorTry simplifying the request and arguments to find the error cause.
October 16, 2023 at 1:29 pm #13516Mikhail
ModeratorCheck the device timeout. It should be > 0.
October 16, 2023 at 5:22 pm #13517kjakan
ParticipantThanks! Device timeout=0 was the error!
October 16, 2023 at 5:38 pm #13518kjakan
ParticipantAnd the username/password had to be given via headers:
Name: Authorization
Value: Basic //Base64 encoded username:password// -
This reply was modified 1 year, 10 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.