Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - EDGAR

Pages: 1 [2] 3 4
16
Technical support / Re:ReadMB2
« on: December 03, 2014, 11:29:54 AM »
Sorry pressed enter too soon.

We even added a chr 10 and 13 at the end of the byte just in case the plc is looking for that but is not working anyway.

We will keep trying and update later tonight...

Thanks,
Ed

17
Technical support / ReadMB2
« on: December 03, 2014, 11:26:46 AM »
Hi,
We are in the process of designing a Modbus slave web service over Modbus tcp but we are getting strange behavior on the plc side. Hope you can help us find the problem.

Here's the PLC code

S = STATUS(3)
if(S = 1) THEN PRINT #4 "</>" ENDIF
 
  //CONNECT TO THE REMOTE DEVICE
  PRINT #4 "<MBTCPCONNECT IPAddress:502>"
  Call wait4conn  //WAIT FOR CONNECTION
  //GET CONNECTION STATUS
  S = STATUS(3)  //S=1 = CONNECTED, S=0 = NOT CONNECTED      
   

   IF S = 1 THEN
      setlcd 2,1, "Reading TEMP...      "  
      READMB2 4,1,40004,DM[151],2
      //DM[153] = ReadModbus(4,1,4)
      N$ = "Waiting response....."
      Call WaitForDataInD
      IF STATUS(2) = 0 THEN
         f$ = input$(4)
         DM[151]=999
         DM[152]=999
         setlcd 2,1, "Reading TEMP failed!!!!   "
      ELSE
         setlcd 2,1, "Reading TEMP success!!!!!"
      ENDIF
       PRINT #4 "</>"
   ENDIF

The actual stream of two requests between the PLC and the slave service is below:

At the ModbusSlave web Service:
Recv From PLC: 006700000006 01 04 9C 44 00 02 | Send From WebSVC: 006700000007 01 04 04 00 00 42 34

Recv From PLC: 008D00000006 01 04 9C 44 00 02 | Send From WebSVC: 008D00000007 01 04 04 00 00 42 34

I can't see where is failing...


18
Technical support / Re:Multiple Socket Support
« on: October 29, 2014, 01:30:42 PM »
Thank you! For now I will use the loop just like the Wait4Conn function shown on the previous post. I will also give the sample a try to see performace and how can we adopt it to our program.

Thanks again,
Ed


19
Technical support / Re:Multiple Socket Support
« on: October 28, 2014, 03:26:48 PM »
Thank You, I added the bolded while loop after finishing with the connection and it seems to be working fine now.


Code:

PRINT #4 "<MBTCPCONNECT "+I$+":502>"
Call Wait4conn  //WAIT FOR CONNECTION
S = STATUS(3)  //S=1 = CONNECTED, S=0 = NOT CONNECTED
   
   IF(S = 1) THEN
      setlcd 2,1, "READING REMOTE DEV..."
      READMB2 4,Q,1000+(O-1),DM[N],VAL(M$)
       IF STATUS(2) = 0 THEN
          setlcd 2,1, "BAD READ ADDRESS..."
          save_eep$ "ERROR READING "+STR$(1000+(O-1)) +":" + STR$(VAL(M$))+" AT " + I$+"."+STR$(Q), 40+L
       ELSE
          setlcd 2,1, "GOOD READ ADDRESS..."
          save_eep$ "GOOD READING "+STR$(1000+(O-1))  +":" + STR$(VAL(M$))+" AT " + I$+"."+STR$(Q), 40+L
       ENDIF
       REFRESH  //REFRESH IO'S    
   ELSE
       setlcd 2,1, "UNABLE TO CONN REM..."
       save_eep$  "ERROR: "+INPUT$(4)+", UNABLE TO CONNECT "+I$+"."+STR$(Q), 40+L
   ENDIF


PRINT #4 "</>"  
while status(3) <> 0
//do nothing...
endwhile



Function Wait4Conn:
I = 1

while STATUS(3) <> 1 OR I > 1000
I = I + 1
ENDWHILE
S = STATUS(3)
I = 1
RETURN


Thanks,
Ed

20
Technical support / Multiple Socket Support
« on: October 28, 2014, 04:27:06 AM »
Hi, I have 2 questions.

1. When communicating with other devices via ethernet, is it possible to use multiple sockets? I.e. Normally we use Print #4 "Data" it will be nice if we can use Print #5 or #19, etc.

2. If number 1 is not available, what's the minimum delay we can use when closing and reopening connections when communicating with multiple devices? I have used delay 1000 and 2000  after closing connection but still get communication errors and unable to connect.

Thanks,
Ed

21
Technical support / Re:Ethernet output buffer?
« on: August 28, 2014, 06:45:07 PM »
You are 100% correct, we completely overlooked the buffer on the server side. Everything is working fine now...

Thanks,
Ed

22
Technical support / Re:Ethernet output buffer?
« on: August 28, 2014, 01:31:22 PM »
Thanks, I will send you the captured session later today.

Ed

23
Technical support / Ethernet output buffer?
« on: August 28, 2014, 07:38:55 AM »
Hello,

We are on the first stages of testing a new web service that will extend current PLC functionality via the web to interface with other web enable device. During the testing we are noticing that the Ethernet output buffer is not clearing after each write. Is there a function or a procedure to clear the buffer that we are missing?

Example:
//Send test string...
PRINT #4 "This is a long string that contains information about this PLC"
//Run your data read loop here....
//Send another string...
PRINT #4 "This is a great PLC"  //but when you look at the server side the text we receive is like this  "This is a great PLCg that contain information about this PLC"

We are getting the remaining char in the buffer "g that contains information about this PLC".

Before and after each command we tried the following loop but it still transferring the same.

While (len(X$) > 0)
   X$ = Input$(4)
endwhile

Anything else you can suggest? Currently, on the server side we are parsing the string up to the first CR.

Thanks,
Ed

24
Technical support / Re:Maximum PLC ID for Modbus RTU
« on: August 02, 2014, 08:00:25 AM »
Hi, and agreed!

You might be able to handle that many devices. However, if you are using RS-485 network,  the RS-485 transceivers may not be capable of driving that many devices in the same network. See http://www.modbus.org/ also see http://en.wikipedia.org/wiki/RS-485 for bias network termination and other details.

Ed

25
General Discussions / Re:Modbus map?
« on: July 30, 2014, 04:37:46 AM »
Not sure I understand your question? The PLC comes with the data sheet that shows you the Modbus address table and reference of each PLC IO.

Ed

26
Technical support / Re:Send SMS Message
« on: May 16, 2011, 03:36:20 AM »
Thank you, would this be a functionality that could be added to these products in the near future?

Ed

27
Technical support / Re:Send SMS Message
« on: May 15, 2011, 06:26:50 PM »
Thanks for the quick reasponse. The test im running, the data comes from a web mail server. The server terminates the data with CRLF and each segment are less than 70 chars long, however I think the data is arriving too fast or the nano internal buffer is over flowing and overwriting the strings. Is the internal buffer also has a max of 70 chars? Or is that even a possibility?

I can only retrieve the end of the message.

Thanks,
Ed

28
Technical support / Re:Send SMS Message
« on: May 15, 2011, 11:54:38 AM »
Does the input$(4) only detect CR or it detects CRLF or LF too? I'm using it and i know the data I'm receiving comes with CRLF at the end of the string, however it seems like this function can't detect CRLF. Also, how big is the ethernet buffer where the input$ function gets the data from?

Thanks,
Ed

29
Technical support / Re:HTTP Post
« on: April 24, 2011, 05:43:43 AM »
Thanks, I'll be using it to parse information requested from the internet as the time server example does. But my problem is that this file is about 1500 bytes too large.

Thanks,
Ed

30
Technical support / Re:HTTP Post
« on: April 23, 2011, 11:49:53 AM »
Hello,

Im using exact same code above to download xml file from the internet. For some reason or memory reason i can only receive the end of the xml file.  

Do I need to do anything different? Don't matter how I change the code it seems like the variables in function 'input$' is being overwritten as data comes in.

Thanks,
Ed

Pages: 1 [2] 3 4