Announcement

Collapse
No announcement yet.

Save Array data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts


  • Save Array data

    I am finishing up a project with a P1000. I setup a main array as a database to store items data (recipe).
    Array is 4000 rows x 16 columns. Integers 32Bit.
    item number in the first column then followed by speed settings for motors, item dimensions, misc settings on machine to match needs of the item in use.

    I would like to export the array to save it outside the PLC if possible.
    Is it something we could use the microSD card for?
    Send array to HMI? (using Maple Systems on this project).

    I'm stuck and would love some pointers in the right direction.
    Ideally, I would setup a bit on PLC to save data, and another to bring data back in.

    Thank you for your help!
    Best Regards,
    Sylvain.


  • #2
    You could probably save it to a MicroSD card. Typically ifd you want data in a computer you would use software on the computer that pulls the data over something like modbus in a way similar to an HMI, only it would be software running on a computer. This can be done with SCADA software, or with a custom program written by you or someone at your company, or there may be premade datalogger software that can run a modbus server and do the necessary transfer.,

    Comment



    • #3
      Hi Sylvain,

      The data logging setup in the P1000 will only log 64 tags. Each element in your array would be considered a tag, so this will not work for you.
      https://accautomation.ca/productivit...c-data-logger/

      As MikeN mentioned you can use third-party software and pull the data out of the PLC. Here is an example using AdvancedHMI. It is a free package that is opened sourced, written in VB.Net and runs on visual studio. The following example uses Modbus TCP to communicate to the P1000 PLC.
      https://accautomation.ca/productivit...communication/

      Hope this helps you out.
      Regards,
      Garry

      Comment



      • #4
        Originally posted by Garry View Post
        Hi Sylvain,

        The data logging setup in the P1000 will only log 64 tags. Each element in your array would be considered a tag, so this will not work for you.
        https://accautomation.ca/productivit...c-data-logger/

        Garry
        It can be coaxed out of the PAC.

        For smaller datasets, I have abstracted the data that the logger 'logs.'
        But for OPs requirements, this may be a bit much. I guess it depends on HOW VALUABLE the data is.

        It is possible that you could calculate Start and End indices into the 2D array and populate and array for logging.
        I have done this with 1D arrays.
        I don't have the time right now to figure out math for it, but MOD and INTEGER DIVISION will be used.

        Do be careful to populate your LOG configuration correctly.
        You are forced to jump from left column to right column and back.
        If you autofill the columns, your data will be skewed 1,3,5,7.... 2,4,6,8.... (at least in the versions in which I have used the logger)

        I do not know how quickly the logger can do its job, or how long you should wait before spamming the logger, so this will be up to OP to determine.
        You will not be able to do this in a For-Loop.

        Comment



        • #5
          Originally posted by kewakl View Post
          It can be coaxed out of the PAC.

          For smaller datasets, I have abstracted the data that the logger 'logs.'
          But for OPs requirements, this may be a bit much. I guess it depends on HOW VALUABLE the data is.

          It is possible that you could calculate Start and End indices into the 2D array and populate and array for logging.
          I have done this with 1D arrays.
          I don't have the time right now to figure out math for it, but MOD and INTEGER DIVISION will be used.

          Do be careful to populate your LOG configuration correctly.
          You are forced to jump from left column to right column and back.
          If you autofill the columns, your data will be skewed 1,3,5,7.... 2,4,6,8.... (at least in the versions in which I have used the logger)

          I do not know how quickly the logger can do its job, or how long you should wait before spamming the logger, so this will be up to OP to determine.
          You will not be able to do this in a For-Loop.
          Interesting way to get the information out indirectly.

          Thanks,
          Garry

          Comment



          • #6
            Originally posted by Garry View Post

            Interesting way to get the information out indirectly.

            Thanks,
            Garry
            Buggers the column headers, but ya get the data.

            Comment



            • #7
              Forum just lost my composition for making this work!
              I have heard of this happening, but just now watched it happen
              Last edited by kewakl; 08-01-2019, 07:01 AM.

              Comment



              • #8
                ** since the dimensions of your source array is a multiple of 16 and 64, no mod and intdiv required. **
                Since your 2D array is 4000 * 16 = 64000 entries, and one Logger Event can log 64 tags, it will require 1000 log events to capture all data.

                Calc SR1, SR2, SR3, SR4 - Since CPA does not copy 2D to 1D across the 2D source array's row boundaries, we will use 4 CPA instructions.

                LE will be the COUNT of Log Events
                RC will be Row Count = 4 rows you could hard code this value, but you will lose the documenting feature of it being a tag

                Calc the StartRows
                SR1 = ((LE - 1) * RC) +1
                SR2 = SR1 + 1
                SR3 = SR1 + 2
                SR4 = SR1 + 3

                Populate 4 CPA instruction using SR1 to SR4 as Start Row *AND* End Row for SOURCE Array respectively.

                For Destination Array's Start Column, you can tag or hard code. 1,17, 33, and 49 respectively

                Count 1 to 1000, with a delay between as mentioned in a previous post.
                After each increment, calc SR1 to SR4, trigger the logger tag, delay, continue.

                Please report back whether this works.
                Last edited by kewakl; 08-01-2019, 08:20 AM.

                Comment



                • #9
                  Well, I have tried twice to edit post 4, but the forum locks up.

                  I wanted to put a note about NOT needing MOD and INTDIV and refer to post 8, but the edit fails to post!

                  Comment



                  • #10
                    Thank you all very much for the detailed answers. Sorry for the delay; working on 2 concurrent projects...
                    I'm looking into the recommendations. I like the data log trick into the 64 tags. I also wonder how long it will take. tests will tell.
                    Then I have to check how to bring the data back from the saved data to the array; a thousand times over.
                    The data is "critical" for this project indeed. The client will create his own settings through the HMI for each of his 4,000 item (max qty). Once the database is over few hundred items, loosing it would be a big issue.
                    Item is selected by the client through barcode. That part works well.
                    Thank you for the help!
                    Sylvain.

                    Comment



                    • #11
                      MikeN, Garry,
                      I looked into using the third party software but I'm not sure I can implement it in my case:
                      My main array data is 4000x16. i can modify my format from Integer 32bit to Integer 16bit to save on my modbus addresses allocation. To communicate with the PC I would have to allocate Modbus addresses to each array cell, correct?
                      This array would fit fine in my 4x. I could allocate it from 4 00500 to 4 64499.
                      My issue now is that I have a second array used with ASCII characters that would also need to be saved. That 1D array is 4000 rows of 25 characters.

                      to get a bit deeper into the details:
                      Database needs to be able to hold 4000 items max. Each item is comprised of:
                      -Item name which is an ASCII string of 25 characters max (from 1 to 25).
                      -16 settings fields (looking into reducing it to 12 possibly)
                      I understood I couldn't use an array with different data format so I created 2 arrays.
                      1D 4000x1 of 25 characters ASCII for the item name and 2D 4000x16 Integer 16 for my settings.

                      Using a barcode reader (serial to P1000) I compare the string coming in to the ASCII array (for loop and compare ascii until it finds the same item name).
                      This equals an Index number which is the actual row on the array. (I used the AD sample on the conveyor for that).
                      That Index allows me to pull the data from the array with my settings (4000x16) in same corresponding row.

                      So I would need to save/Export both arrays, 2D 4000x16 Int 16 unsigned and 1D 4000x1 Ascii (25 characters). And will need to Import both data sets back as needed to populate the 2 arrays in the PLC.
                      I don't think I have the room to allocate both arrays to my Modbus addresses unless I'm missing something.

                      So, I'm going to look deeper into the microSD card option.
                      Thanks!
                      Sylvain.

                      Comment



                      • #12
                        For some reason I was thinking along the lines of the old "Point of View" software that is no longer sold through Automation Direct, but actually what I should have suggested was DataWorx which AD does still sell. I have heard the software is a bit cumbersome, but it is rather cheap overall and Productivity has direct integration with it through the DataWorx Request instruction. This lets you send and retrieve data directly from fields within an SQL database. With multiple arrays of 64,000 tags to transfer I would think this database integration will be what you are looking for. Kewald's trick is nice if you dont have a lot of data to save, but I think it would be way too cumbersome with the vast quantity of tags you want to save.

                        https://www.youtube.com/watch?v=25NLnwTW2DE
                        https://www.automationdirect.com/adc...c/pc-datplc-un
                        Last edited by MikeN; 08-06-2019, 11:41 AM.

                        Comment



                        • #13
                          Dataworx is sold thru AD
                          but DataworxP3K is retired.
                          seems you must get thru bizwaredirect.
                          $795.00

                          I have several complaints with DataworxP3K which never were resolved. the first few...
                          1. the software seems to have been developed in VB6 (observational.) It had the error dialog 'subscript out of bounds error' (error 9) that I saw a lot in vb6
                          I guess that I could fire up Spy++ and find out if DWX has hWnd = ThunderRT6FormDC
                          2. it would crash to desktop if you did anything unexpected by the configurator - (I don't have it installed, so I cannot get the exact naming)
                          3. I saw several times that I would get a success status in the DWX instruction - even if there was NO server connection.
                          4. to this day, I have a couple sequences that receive a fault confirmation state - multiple times, but when I check the database, the data is written EVERY time?
                          5. the (bizware) developers (NOT the AD techsupport) suggested that I wait one minute between executing the instruction and expecting a result. I don't have that kind of time to wait!




                          Last edited by kewakl; 08-05-2019, 10:33 AM.

                          Comment



                          • #14
                            MikeN, Kewakl,
                            Thank you for the new recommendations. Nothing is simple in our world...

                            Comment

                            Working...
                            X