1

I have telescope a it is managed with PLC siemens. This telescope is remote. I have group of the commands which i can send by TCP/IP to execute. This commands are in ASCII format. Here is simple example of script:

import socket TCP_IP = '' TCP_PORT = s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((TCP_IP, TCP_PORT)) s.send('GLLG 0\r\n') s.send('DOSO 0\r\n') data = s.recv(1024) print data s.close() 

I send two commands. First is for login a second is for opening dome. But I have two half dome. When I send this command for opening dome it is opened only one half of dome.

But takes some time before half-dome opens and I must wait for send next command to open whole dome. My question is?

Is it possible to follow instructions?

When make one command send another automatically?

Wait until execute one command and after this send next command?

9
  • What happens if an open request is sent for the second half before the first-half has opened? Commented Feb 20, 2014 at 15:15
  • The commands you send, do they get a reply when they are completed? If you have control over the protocol you might think about adding it if it's missing. This kind of request-response is very common in many network protocols. Commented Feb 20, 2014 at 15:17
  • Nothing...When i send three commands - login - doso - doso execute first a second command. Third no. But when the half dome is open and a send doso command again second half-dome opened Commented Feb 20, 2014 at 15:19
  • Yes i get replay - logic 1 for example I send command login-doso-doso and I get 1 1 1...But execute only first two. Commented Feb 20, 2014 at 15:22
  • If each command gets a reply, then you should wait for it before sending the next command. Commented Feb 20, 2014 at 15:24

1 Answer 1

1

If the PLC will send a response back of some sort that confirms that the open of the dome is complete please read that and then send the next command.

Also make sure you send all your strings as binary unless your PLC can handle unicode.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.