![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#61 |
Lifetime Supporting Member
|
|
![]() |
![]() |
#62 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 427
|
|
![]() |
![]() |
#63 |
Lifetime Supporting Member
|
For the record I am still here. I just haven't gotten back to working on this project. Also the whole point of this thread was doing it directly. I guess I wasn't completely clear on that in my original post.
I have other project chaos to wrangle. OT: Who the hell would ever want to be a project manager it stuck. I have to wear many hats, project manager is not one I enjoy.
__________________
SkyCad is by far the Best ECAD Schematic Software I have used. Fact my "Fun Facts" are never fun ![]() |
![]() |
![]() |
#64 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 427
|
theColonel26, good you are sticking around because I have good news. I was about to roll-up my sleeves and try PCCC mapped tags, but after dusting-off the PCCC spec I realized it would be more difficult than I thought. So I setup one particular third-party (non-Rockwell) Windows application that can read Logix tags and did a bit of Wirehsark analysis. Then I realized that if one is able to find out the instance of the symbol class (class ID 0x6b) for the particular tag within the Logix processor, then you can access the data with a non-documented (or maybe it is documented but I need to study further) service 0x52. Have a look at the screenshot below. It is really cool. I need to find out how to write data to a particular tag, then I will write the Codesys program, for which I should be able to use the 3S libraries.
Last edited by AlfredoQuintero; November 20th, 2020 at 12:50 AM. Reason: Minor typo |
![]() |
![]() |
#65 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 427
|
And this is how to send data to a Logix tag. In this case the tag FromCodesys_20words was assigned instance 11 by the Logix application. The service for writing data to a tag is 0x53. I think 0xC4 is the datatype DWORD in CIP spec (...yes it is, just checked the spec.) and 0x14 is the 20 words that are being sent to this tag.
|
![]() |
![]() |
#66 | |
Member
![]() ![]() Join Date: Jan 2013
Location: Germany
Posts: 1,192
|
Alfredo, your suggestion to find the instance number, is exactly steps 1 through 5 of this document.
Quote:
http://www.plctalk.net/qanda/showpos...3&postcount=10 Last edited by AustralIan; November 20th, 2020 at 02:21 AM. |
|
![]() |
![]() |
#67 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 427
|
AustralIan, thank you very much. Now that I have done all I did I can more or less understand this code. For a practical application in Codesys though, do you think it is necessary to automate the process to find out the instance. I would do this part manually because the instance of the tag should not change once the Logix program is ready.
|
![]() |
![]() |
#68 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 427
|
I was able to write a program which can read data from Logix tags into Codesys variables using ENIP.Generic_Service. However now I realize this service cannot be used to send data from Codesys variables into Logix tags, because this ENIP.Generic_Service is not generic enough, as it only supports logical segments with Class, Instance and Attribute or Class and Instance elements in the CIP path. For the service 0x53 it is necessary the support for Member in the CIP logical path. Let's hope 3S adds in the future a variant of this ENIP.Generic_Service function with a more flexible CIP path structure. Hope this is helpful.
|
![]() |
![]() |
#69 |
Member
![]() ![]() Join Date: Jan 2013
Location: Germany
Posts: 1,192
|
Hi Alfredo, Colonel.
Can you check out my READ_TAG / WRITE_TAG FB's? It needs that dummy DINT[2] in the CLX to establish a connection. So far I think it will only work with non-structured, non-array datatypes. And only controller scope tags. Let me know if you need arrays, structs, or DINT.Bit and I will see what I can do adding these on. |
![]() |
![]() |
#70 | |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 427
|
Quote:
I have tried to make it work. So far I have only tested the reading of Logix tags. I can only get the first DWORD of the tag. I will modify the program to be able to pass the number of elements to read or write. I had an issue with the write function which crashed the PLC application There may be some pointer issue there. I intend to post the program when I get it working. By the way how do you attach screenshot files with only a link to them? I always get the screenshot below the text. |
|
![]() |
![]() |
#71 | |
Lifetime Supporting Member
|
Quote:
Based on observations: When there is only one image attachment in the pos, the forum software shows the image to the image at the end (unless it was inserted earlier). If there is more than one attachment, then the forum software displays links to all attachmnets, including any images, at the end. |
|
![]() |
![]() |
#72 | |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 427
|
Quote:
Thanks. |
|
![]() |
![]() |
#73 |
Member
![]() ![]() Join Date: Jan 2013
Location: Germany
Posts: 1,192
|
Hi Alfredo, Thanks for debugging it and adding some features
![]() I could not find a cause of PLC crash in the WRITE_TAG()... but there was an error. Line 122 of WRITE_TAG should read: Code:
IF Response[4] = 16#CD AND Response[5] = 0 AND Response[6] = 0 AND Response[7] = 0 THEN |
![]() |
![]() |
#74 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2015
Location: Yokohama
Posts: 427
|
Hello AustralIan and theColonel26:
I have added more features to AustralIan's program. Now you can pass the pointer of global variables in the Codesys PLC application to the read and write functions for Logix so you can get the process data neatly separated from the protocol overhead. I have not tested with data types other than DWORD, so for different data types there may be some issues that would need to be tweaked. I hope this is helpful. |
![]() |
![]() |
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 |