Jump to content

Datas from Data Table fails to be read correctly


Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...