![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#31 |
Member
![]() ![]() Join Date: Jan 2013
Location: Germany
Posts: 1,196
|
I have done some playing with two codesys PLCs, and you have it right: with no connections listed on the Remote Adapter's Connections tab, it does not go to Running. Adding a valid connection gets it to running. Once in running, the generic service works.
The thing is, valid connections here are only special class 1 connections, you can't just choose any available service/class/instance/attribute. The only class 1 connections I know of for a Logix Processor are produced tags. I couldn't find a document describing the correct format for these produced tags. I assume it would just be the symbolic path... But how much data does it need to send? If someone has a wireshark of a successful Produce Consume, you or I could dissect it and see what is needed. |
![]() |
![]() |
#32 |
Lifetime Supporting Member
|
@dmroeder
Do you have any incite in to this lower level stuff we are talking about? I think so far the issues seem to be codesys related.
__________________
SkyCad is by far the Best ECAD Schematic Software I have used. Fact my "Fun Facts" are never fun ![]() |
![]() |
![]() |
#33 |
Lifetime Supporting Member + Moderator
|
I realize that most of the effort here is going toward using the message router or finding a way to get CoDeSys to natively run a 0x4C or 0x4D service.
But I did spend some time this weekend learning how CoDeSys handles embedded external files, including text files and Python scripts, and how to execute them with the SysProcess library from inside a CoDeSys logic routine. When I run simple Python scripts that just print something to stdout, the result happily shows up in a string in CoDeSys. But when I execute a PyLogix script, which includes printing the result to stdout, there's an Error Code 25 and no data in response. If I put a print() function at the start of the script, that line does appear in stdout. Maybe it's the time that PyLogix takes to import and call and execute and generate a result, even though it's only a few milliseconds, that prevents SysProcess.SysProces***ecuteCommand2 from seeing the result. If I figure out that method, I'll post (maybe as a separate thread). Last edited by Ken Roach; November 16th, 2020 at 12:41 AM. |
![]() |
![]() |
#34 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 439
|
AustralIan and theColonel26:
Hello. I am either doing something very silly or I may be very close. I created the tags FromCodesys_20words and ToCodesys_10words in Logix. Then in Codesys I created a connection with the symbolic syntax as per below: 91 13 46 72 6f 6d 43 6f 64 65 73 79 73 5f 32 30 77 6f 72 64 73 I am getting from Logix a Forward Open failure response with extended status "Invalid Network Connection Parameter." It seems the path is being understood, but my understanding of the CIP communication parameters is fuzzy. Tried a number of things but can't get it working. Any suggestions? |
![]() |
![]() |
#35 |
Lifetime Supporting Member + Moderator
|
Alfredo, can you ZIP and post that CoDeSys project file ? I'd like to take a look at it myself, and my platform is a Raspberry Pi B+ running CoDeSys 3.05.16.
|
![]() |
![]() |
#36 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 439
|
Ken, hi. Sure. Here it is. Hope it is useful. My platform is exactly the same as yours.
|
![]() |
![]() |
#37 |
Lifetime Supporting Member
|
AlfredoQuintero
If you select "Path defined by symbolic name" it does the conversion for you I think. So just put in the tag name. Do you have access to a Allen Bradley PLC? What model are you using? just curious. If you want to do it manually like you are you need to use "User -defined path" The problem with that dialog is that it doesn't allow you to specify a service. Which is why we are using the generic_service function block.
__________________
SkyCad is by far the Best ECAD Schematic Software I have used. Fact my "Fun Facts" are never fun ![]() |
![]() |
![]() |
#38 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 439
|
If you see the lower half of screenshot in post # 34 you can see the 1769-16ER that I am using. The symbolic path does the conversion? I did not know this. Will try this out later. This may be the reason why it is not working. Will also try what you suggest about user-defined path.
The reason this dialog does not allow one to specify a service is because this dialog is for the definition of connections. Connections are established with the Forward Open command and then the communication takes place implicitly. It is not possible to define services other than Forward_Open and Forward_close. Any ways in order to do explicit messaging, you need to get the scanner running, even if there is no valid implicit connection. Codesys needs to have a handle for the remote adapter to which explicit messages are to be sent. I am not sure how this generic_service function block is used. Will need to study this further. Do you mean you can use CIP services other than those indicated in this link? |
![]() |
![]() |
#39 |
Member
![]() ![]() Join Date: Jan 2013
Location: Germany
Posts: 1,196
|
Alfredo, make sure you have those tags in your Connection set up as produce tags on the CPLX.
|
![]() |
![]() |
#40 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 439
|
AutralIan: tried to do as you say but, do not get a connection.
theColonel26: You are right about the sybol syntax in Codesys. It is much easier doing it like this. Thanks for the hint. Will keep trying but may need some help from either of you or Ken. |
![]() |
![]() |
#41 |
Member
![]() ![]() Join Date: Jan 2012
Location: melbourne
Posts: 175
|
@alfredo
I think you need go add 2 bytes at the beginning 4C 0B The a pad byte 00 at the end to make up the 11 words 4C 0B 91 13 46 72 6f 6d 43 6f 64 65 73 79 73 5f 32 30 77 6f 72 64 73 00 |
![]() |
![]() |
#42 | |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 439
|
Quote:
chelton, hi. Thanks for your comments: This explanation of yours, do you mean using the "Read Tag Service" (service ID 0x4C) by means of MSG instructions? Last edited by AlfredoQuintero; November 17th, 2020 at 03:25 AM. Reason: minor typo |
|
![]() |
![]() |
#43 |
Member
![]() ![]() Join Date: Jan 2013
Location: Germany
Posts: 1,196
|
Alfredo, Produced Tags are, as the CODESYS scanner would see it, Target -> Scanner. In your screenshot you have 0 bytes in there and 40 in Scanner to Target.
|
![]() |
![]() |
#44 |
Member
![]() ![]() Join Date: Nov 2020
Location: SEDSF
Posts: 1
|
I've seen some examples of executing external routines using the SysProcess.SysProces***ecuteCommand2 function, so there might be a way to use the PyLogix library, or some other library to execute a tag read or write, without adding another element of middleware.
|
![]() |
![]() |
#45 | |
Lifetime Supporting Member
|
Quote:
__________________
SkyCad is by far the Best ECAD Schematic Software I have used. Fact my "Fun Facts" are never fun ![]() |
|
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cheap PLC that can read Data from its SD card or USB Flash Drive? | theColonel26 | LIVE PLC Questions And Answers | 10 | May 25th, 2019 11:38 AM |
FactoryTalk 8.0: how to display choosen tag value from PLC | Suseh | LIVE PLC Questions And Answers | 4 | June 18th, 2015 02:59 PM |
Any idea how to access the Omron simulator? | strantor | LIVE PLC Questions And Answers | 9 | March 13th, 2015 07:01 PM |
RSLogix 5000 Multiple Aliases to Same Tag | davidc100 | LIVE PLC Questions And Answers | 10 | May 27th, 2014 09:04 PM |
Read and write data from pc to plc via rs232 cable | MANISH VORA | LIVE PLC Questions And Answers | 4 | August 23rd, 2011 02:47 PM |