Nick. Posted February 7, 2018 Report Share Posted February 7, 2018 I new to the Ethernet card with the unitronics is there a way to send a command to a LAN web page? I'd Like to send commands like HTTP:\\192.168.1.4/30000/00 HTTP:\\192.168.1.4/30000/01 and so in Quote Link to comment Share on other sites More sharing options...
MVP 2021 Joe Tauser Posted February 7, 2018 MVP 2021 Report Share Posted February 7, 2018 Look at the Help on the TCP_RAW block. Joe T. Quote Link to comment Share on other sites More sharing options...
Nick. Posted February 9, 2018 Author Report Share Posted February 9, 2018 Joe I'm not sure what I'm doing wrong. please look at my ladder and let me know? V230 TCP Raw.vlp Quote Link to comment Share on other sites More sharing options...
MVP 2021 Joe Tauser Posted February 9, 2018 MVP 2021 Report Share Posted February 9, 2018 I may have led you astray. It dawned on me when I looked at your code and your initial post that HTTP usually uses port 80. It is also available in the Protocol choices when you configure a Socket Init. Unless you're using one of the old controllers with the Standard Instruction Set like a V230. Then it's not there. The TCP_RAW block just throws out what you feed it. What do you have connected to the other end? Are you using an Ethernet terminal program to look at what it's sending? Joe T. Quote Link to comment Share on other sites More sharing options...
Nick. Posted February 9, 2018 Author Report Share Posted February 9, 2018 I'm trying to run a network relay the relay is on IP 196.168.1.4 port 30000 the command to turn on relay number 1 is 192.168.1.4/30000/00 in a web browser I tried using a number of ports including HTTP on port 80 I also tried using a V230, V570 and a V1040 every time I get a -6 on the status bit = send failed Quote Link to comment Share on other sites More sharing options...
MVP 2021 Joe Tauser Posted February 9, 2018 MVP 2021 Report Share Posted February 9, 2018 You are out of my area of expertise with this. Sorry. But your code looks correct. What about the terminal idea? Unfortunately the Creators have gone home for the weekend. Hopefully another forum member has some experience here. Joe T. Quote Link to comment Share on other sites More sharing options...
hotwires Posted February 9, 2018 Report Share Posted February 9, 2018 Wireshark should work as a packet sniffer in this experiment. Should be doable with Enhanced Vision controllers. sorry I can't exactly tell you how to either. Quote Link to comment Share on other sites More sharing options...
MVP 2021 Ausman Posted February 9, 2018 MVP 2021 Report Share Posted February 9, 2018 Joe and Hots have way more knowledge on this than me, so probably showing my networking ignorance..... Have you tried leaving the socket open? Also, perhaps you could try doing the send as the entire address, port and activation number? I only mention this because I frequently use cheap(er) PTZ cameras that often want a "complete" send when accessing them. As in, the full http:// in the address as well. Also, they often interchange : with / or vice versa without mentioning that in manuals. I often have to muck around with addressing protocol to get them to work properly. They sometimes use an "adjacent" port as well. Do a sniff (Angry IP etc) on your network to make sure that the relay is just using the one port. Ohh yeah...you do actually mean http:// don't you ... not http:\\ ?? Maybe this might help. It will help to keep your weekend busy anyway! cheers, Aus Quote Link to comment Share on other sites More sharing options...
Nick. Posted February 16, 2018 Author Report Share Posted February 16, 2018 I got it working Thanks for all the help Quote Link to comment Share on other sites More sharing options...
MVP 2021 Joe Tauser Posted February 16, 2018 MVP 2021 Report Share Posted February 16, 2018 What did you do? Did embedding the entire string do the trick? Joe T. Quote Link to comment Share on other sites More sharing options...
Nick. Posted February 16, 2018 Author Report Share Posted February 16, 2018 I'm not sure why but after i send the command the relay it auto disconnects so i had to add a auto reconnect Let me know if there is a better way to do this. Thanks V570 Relay Test.vlp Quote Link to comment Share on other sites More sharing options...
MVP 2021 Joe Tauser Posted February 18, 2018 MVP 2021 Report Share Posted February 18, 2018 Your code is actually fairly straightforward and easy to read. One thing I would change is how your command numbers get set. This is a classic example of how Unitronics doesn't always compile the way we think it will. In this code- The logic I see is "If SB 147 and MB 460 pressed then Toggle MB 450 then based on MB 450 write either 0 or 1 to MI 60 and set MB 470". So I'm guessing you want to toggle MB 450 first and then write a number. But that's not how it compiles. Look at the STL Quick View for this network (right click on the network number)- "!" is the beginning of a logical statement the PLC solves. So let's break it down: 1. ! - Look at the state of MB 450 and copy it to LB 0 (local scratch bit 0) 2. ! - Look at SB 147 and the Rising edge of MB 460. If true, toggle MB 450. So far so good. 3. ! - Look at SB 147 and the Rising edge of MB 460 (again) AND the state of LB 0. If true, write 1 to MI 60. But wait! Didn't we want to toggle MB 450 and then consider it's state for the Store blocks? As you can see, this won't happen. General rule of thumb for Unitronics programming. If you operate on a bit (MB or timer), don't use it as a condition in the same network. To get predictable results, you need to break the network apart: I realize this seems redundant and illogical. But that's how it is. Enter this logic and look at the resultant STL views to see for yourself. Joe T. 1 1 Quote Link to comment Share on other sites More sharing options...
MVP 2021 Ausman Posted February 18, 2018 MVP 2021 Report Share Posted February 18, 2018 Great explanation, Joe. And humour as well!! cheers, Aus Quote Link to comment Share on other sites More sharing options...
MVP 2021 Flex727 Posted February 19, 2018 MVP 2021 Report Share Posted February 19, 2018 Flex's Law of Ladder Logic: Unitronics does NOT charge you by the rung! Break up you code to the most simple logical elements. It makes sure you get the compile you want AND makes the code easier to read and debug. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.