You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old November 15th, 2020, 01:29 AM   #31
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Germany
Posts: 1,184
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.
  Reply With Quote
Old November 15th, 2020, 02:26 PM   #32
theColonel26
Lifetime Supporting Member
United States

theColonel26 is offline
 
theColonel26's Avatar
 
Join Date: Feb 2014
Location: West Michigan
Posts: 501
@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
  Reply With Quote
Old November 16th, 2020, 12:36 AM   #33
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 15,677
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.
  Reply With Quote
Old November 16th, 2020, 12:37 AM   #34
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 364
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?
Attached Images
File Type: jpg 20201116CodesysLogixSymbolic1.jpg (209.2 KB, 72 views)
  Reply With Quote
Old November 16th, 2020, 01:29 AM   #35
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 15,677
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.
  Reply With Quote
Old November 16th, 2020, 01:37 AM   #36
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 364
Quote:
Originally Posted by Ken Roach View Post
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.
Ken, hi. Sure. Here it is. Hope it is useful. My platform is exactly the same as yours.
Attached Files
File Type: zip Raspb_04_LogixTagTest_00.zip (139.5 KB, 1 views)
  Reply With Quote
Old November 16th, 2020, 10:24 AM   #37
theColonel26
Lifetime Supporting Member
United States

theColonel26 is offline
 
theColonel26's Avatar
 
Join Date: Feb 2014
Location: West Michigan
Posts: 501
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
  Reply With Quote
Old November 16th, 2020, 05:01 PM   #38
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 364
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?
  Reply With Quote
Old November 16th, 2020, 05:24 PM   #39
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Germany
Posts: 1,184
Alfredo, make sure you have those tags in your Connection set up as produce tags on the CPLX.
  Reply With Quote
Old November 16th, 2020, 08:56 PM   #40
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 364
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.
Attached Images
File Type: jpg 20201117_Logix_Codesys.jpg (205.7 KB, 52 views)
  Reply With Quote
Old November 17th, 2020, 01:01 AM   #41
chelton
Member
Australia

chelton is offline
 
Join Date: Jan 2012
Location: melbourne
Posts: 157
@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
  Reply With Quote
Old November 17th, 2020, 03:25 AM   #42
AlfredoQuintero
Lifetime Supporting Member
Japan

AlfredoQuintero is offline
 
Join Date: Feb 2015
Location: Yokohama
Posts: 364
Quote:
Originally Posted by chelton View Post
@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

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
  Reply With Quote
Old November 17th, 2020, 07:25 AM   #43
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Germany
Posts: 1,184
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.
  Reply With Quote
Old November 17th, 2020, 08:50 AM   #44
deolsunny533
Member
India

deolsunny533 is offline
 
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.
  Reply With Quote
Old November 17th, 2020, 10:30 AM   #45
theColonel26
Lifetime Supporting Member
United States

theColonel26 is offline
 
theColonel26's Avatar
 
Join Date: Feb 2014
Location: West Michigan
Posts: 501
Quote:
Originally Posted by AlfredoQuintero View Post
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?
Yes, that is just an enum supplied with the library. you should be able to send any hexdec value you want with it. My understanding is that all this is doing is sending a value that represents the requested service. It is up to the remote device to interpret that value and send back the correct data.
__________________
SkyCad is by far the Best ECAD Schematic Software I have used.


Fact my "Fun Facts" are never fun
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
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


All times are GMT -5. The time now is 08:31 AM.


.