Sideway Posted October 26, 2021 Report Posted October 26, 2021 Hi everyone, EDIT : *** I realized my post was a bit tough to read so i decided to rewrite it from scratch *** Context : I currently work on a small automation program (Hereafter is the 1st topic i wrote about it). I updated this program now (see attached file) and i encounter a really weird problem. In my main routine, i send CANopen frames via SDO Download function to parametrize my variable frequency drives. I load the content of each SDO message by using four Data Tables as a dictionnary : "Mapping Table" --> Used for PDO mapping "Start-up Table" --> Used for drive start-up (DS402 CANopen) "Settings Table" --> Used for motor limit values "Homing Table" --> Used for motor position initialization Each of these tables has the same structure : Column 1 : Index of the drive Object Dictionnary (OD) Column 2 : Subindex of the drive OD Column 3 : Data of the SDO message Column 4 : Size of the SDO data to be sent Each column represents a parameter for the SDO Download function. Issue : The values send by SDO from my PLC are not received correctly by the drives. As i read through my DataTables line by line, the 3rd column appears to be shifted by 1 line when i load my SDO function. But i cannot figure where the problem occurs in my program : All values are set to 0 at power up (using XIs to count rows going through my data tables), and seemingly i increment my row number AFTER reading the table, so why is there a shift in my 3rd column ? 🙄 Observations : After analyzing the CANbus frames (see link in post-scriptum for how i proceeded), i realized the DataTables were read correctly only in the first, the second column and fourth column. This leads to truncated values sent through my CANbus (when, according to my row number, i want to send a 1-byte value but the 3rd column content is 4-byte long) as i could note from my CANanalyzer. I linked an .ods file containing a list of the CANopen frames read by the V130. (Red columns = col1 , 2, 3 and Yellow column = col4 of my DataTables) Now, you may compare these values with the values actually stored in my DataTables in my Visilogic file. Cheers, Sideway. P.S. : Method i followed to create a CANopen sniffer with my V130 : CANbus Message to Data Table (unitronicsplc.com) pilotage_moteurs_Y_v1.0.vlp canopen sniffer sep virgule v2.ods
Sideway Posted October 27, 2021 Author Report Posted October 27, 2021 I found out how to solve my problem : The SDO function was located above my subroutine calls within my main routine. It generated a shift of my data table reading, though i can't explain it... Sideway.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now