Exporting Array from Codesys to Text or Excel

standeven
2015-10-08
2018-10-10
  • standeven - 2015-10-08

    Hi,

    I wrote some code which logs numerical data into an array. The problem is getting this data from the array into text, excel, or some other format where I can manipulate and analyze the data.

    When I go online with a laptop, I can easily copy one array value and paste it into a text file. Unfortunately, I cannot determine a way to select multiple lines or copy the whole array of values. I can manually type out these values, but with hundreds of values it would take too long. I've tried logging remotely over CAN, but I cannot transmit and record at an acceptable speed. I really need these values logged as fast as the scan cycle will allow.

    Any solution that I'm missing? I'm really surprised I can't just copy/paste a list of array values from codesys!

    Thanks

     
  • shooter - 2015-10-08

    what plc and type is used, what communication can be used

     
  • Anonymous - 2015-10-09

    Originally created by: scott_cunningham

    If you hardware has a flash drive or hard drive, then you can use the sysfile library for read/write access and just save your data as a csv type file.

    If not, you can send the data via communications, like a serial stream, or as an email, etc.

    I know you are using v2.3 based on the post folder, but for users using v3.x, they can also use Python scripting can access program variables - but that's only good for online mode.

    Respond to shooter's post if you need more detailed information.

     
  • hendrikvdv - 2018-10-10

    Hi
    I am a new user of codesys, and i want to do the same thing.
    I have a MOVI-C controller from SEW,
    And I need to get values from codesys to excel.

    I could put them in a trace, and then make a csv file from that trace, but there has to be a better way.
    Also, this gives a measerment every cycle, or x cycles, and not when i want to.

    my controller has 2 usb ports. I dont know if they can be used to write to.
    I have tried some code that i found here for rasberry PI, to write to csv, but that won't download.

    how do i know if my hardware has a flash/hard drive?

     

Log in to post a comment.