DataStore Plus "step by step" setup in FactoryTalk ViewStudio


Earlier in the week we described what the DataStore Plus ActiveX was.

Today we walk you through the steps you need to take to add it to a FactoryTalk ViewStudio Machine Edition project.

Basic steps to setup the DataStore Plus ActiveX in ViewStudio:

  1. ViewStudio SplashCreate and configure a new “on top” display to host the DataStore Plus ActiveX
  2. Add and configure the DataStore Plus ActiveX to the new display
  3. Set the DataStore Plus display as the project's new initial graphic
  4. Configure the DataStore Plus display to load your original initial graphic display by:
    • Creating an HMI Tag
    • Assigning the HMI Tag to the Global Connection's “remote display number”
  5. Create and assign two macros
    • Create first macro to trigger original initial graphic by setting the HMI Tag to the original initial display's number
    • Create second macro to reset the HMI Tag to “0”
    • Assign the first macro to the DataStore Plus “on top” display's startup macro setting
    • Assign the second macro to the original initial display's startup macro setting

Now on to the detailed steps:

DataStore Plus Step 1:

The first step to using DataStore Plus is to create a new graphic display in your project to “host” this ActiveX. To do so, create a new graphic display with these display settings:

On the General Tab

  • On Top
  • Cannot be replaced
  • Display Number 999
  • Maximum Tag Update Rate of .25
  • Specify Size of 400 width and 400 height
  • X and Y position of -401 and -401 (off the visible screen)

Note: Below is a picture of my display settings:

DataStorePlus Step 1

Explanation of above settings:

Since we want the DataStore Plus ActiveX to run while the PVPlus project is running, we need to keep the display it's on open at all times. One way to accomplish this is to set the display as “always on top,” and “cannot be replaced.” However, we don't actually need to see this display, so we also position it out of the visible pixel range with a negative X Y position.

DataStore Plus Step 2:

Now that our graphic display is created, we need to add the DataStore Plus ActiveX to it. To do this, choose ActiveX from the Objects Menu:

DataStorePlus Step 3

Click and drag a box on your display. When you release the mouse, you'll be prompted to choose an ActiveX – choose the ME DataStore Plus ActiveX and press OK:

DataStorePlus Step 4

This is now what your graphic display screen should look like:

DataStorePlus Step 5

Next, double click on the DataStore Plus object and set the general settings to meet your preferences (mine are shown below:)

DataStorePlus Step 6

Do the same on the Advanced tab (my advanced settings are shown below:)

DataStorePlus Step 7

Finally, on the Connections Tab you'll need to fill in the “File Location” (includes file name and CSV extension,) “Trigger” (this acts as an enable,) and add at least one real or string tag (my settings are shown below:)

NOTE: “FileLocation” can either be a String Tag which contains the full path and file name for your CSV file, OR it can be the actual full path and filename included within quotes as shown below:

DataStorePlus Step 8

Next press Apply and OK, then save your screen with a memorable name (I saved mine as DataStore Plus)

DataStore Plus Step 3:

In this step you need to set your DataStore Plus display as the new initial display, after recording what the initial display is currently set to. This is done in “Startup”

DataStore Plus Step 4:

Now that our DataStore Plus display is setup as the initial display, it will launch when the project runs. However, if we do nothing else we'll be left with a blank gray screen.

So our next step is to setup our DataStore Plus display to launch our original initial display. To do this, we first need to create a new HMI tag as shown below:

DataStorePlus Step 9

Now let's set our new “RemoteDisplayTag” to be the Global Connection's “remote display number” tag as shown below:

DataStorePlus Step 10

DataStore Plus Step 5:

Now we need to create two macro's. One to change our “RemoteDisplayTag” to the number of our original initial graphic display (in my case “1”.) And another to reset it back to “0” so the operator can navigate to other displays.

Below is the first of the two macros we must create. This is the one our DataStore Plus screen will trigger after opening, to then trigger the opening of our original initial display.

Note: Changing the tag associated with the Global Connection for “remote display number” to “1” will cause the system to display the graphic display with that corresponding display number. However, the operator will not be able to navigate away from that screen until the “remote display number” is changed back to “0”

Note: Always be sure when implementing “remote display number” that all your displays have a unique “display number” in display settings.

DataStorePlus Step 11

Below is the second macro we must create. It will be launched by our original initial display to reset the “remote display number” tag to “0” so the operator can navigate to other displays:

Our final step is to set our two displays to run the appropriate macros.

First, on our DataStore Plus display we need to open the display settings. Then on the Behavior Tab we add our “Macro_GotoMainScreen” to the Macro Startup field as shown below. When done press OK, then save and close the display:

Next, we need to open our original initial display and on the Behavior Tab in the display settings we need to add “Macro_ResetRemoteDisplay” to the Macro Startup field as shown below. When done press OK, then save and close the display:

DataStorePlus Step 14

At this point we've successfully added the DataStore Plus ActiveX to our project. Once we run our project we can open Windows explorer to look for our next CSV datalog file. Just navigate Windows Explorer to the location specified in the DataStore Plus ActiveX's “FileLocation” property, and you should see the first CSV log file.

DataStorePlus Step 15

If you open the file in Microsoft Excel, you should find data similar to what you see in my file below:

DataStorePlus Step 16

That's it for DataStore Plus ActiveX step-by-step.

If you have any questions or comments please don't hesitate to let us know by either using the “post a comment or question” link below.

Sincerely,

Shawn Tierney
Automation Instructor and Blogger
If you enjoyed my article, you may like my courses at TheAutomationSchool.com


Click HERE to scroll down to view or leave comments


Forum Comments:
  1. I would like to know if the methods outlined in this thread are so data captured historically could be sent to ao USB or SD Card for extraction later via csv file format. Is this true? How would you be able to remove the device when you want to see the data without harming the process?
    Thank you
    Carissa
    Just wanted to give whoever is reading this a heads up. I ran into this in the field, and found that these ActiveX objects are NOT intended to be used for "On Demand" logging, meaning they are not intended for the PLC to actually trigger the individual logs. It was designed to be a purely TIME-BASED logging setup, where the "Enable" is supposed to be left on for long periods of time. The reason for this is that if the Enable is not set during the midnight transition, the object will not make a new file for the next day, but instead continue writing the log entries in the previous day's file, until the log enable just so happens to be enabled during that transition, and only THEN will it create a new file. I wrestled with this for months, unable to explain why the files would seemingly just randomly generate, but there would be several days to several weeks' worth of entries in a single day's file. There was no rhyme or reason to when the system would generate a new file, and as far as I could tell, I had it set to start a new file every day, so my work was done.
    Then, finally, I found the technote that mentions the midnight transition, and how logging has to be enabled during this in order to facilitate the file name change. I was logging at intervals that included midnight anyway, but since the time between the HMI and PLC is not always perfectly synced, I just extended the time to ensure they'd be on at midnight. Unfortunately, I would create situations where there would be "multiple logs" for certain times. At any rate, it wasn't a "clean" solution.
    But, I did find a workaround that, as far as I have lab tested so far, seems to work well. In a nutshell, you take the file name control away from the ActiveX Object and give it to the PLC. By periodically (about once an hour) syncronizing my PLC and HMI clocks, I can make sure new files are created and the entries are stored in the correct day flawlessly and cleanly. In the PLC, I create several string tags and, using conversion and concatenating instructions, "assemble" the log file name in the program, based on the current date. I then point the field in the ActiveX setup to that tag instead of typing it out. This also gives me the option to easily change where the file goes on the fly, in case my customer connects the HMI to their network and wants those log files to go onto a server folder, without having to edit the HMI program.
    I tested it out in the office here, and it worked wonderfully. I was able to change my PC's date, and it created a new file. I even changed the date back, and the object would simply append the existing file with the new entries.
    If you're using this to log data on an "On Demand" basis, this is the way to do it.
    Halo.
    I am trying the steps above using Factory Talk View V8.1 but I am unable to complete steps 3 through 5 because I am not seeing other options on the explorer such as Startup and Global Connection. Please assist.
    Hey Bellgast,
    While this article is from 2013, ViewStudio ME 8.1 still has Startup and Global Connections.
    Are you trying to use it with ViewSE? Datastore Plus will work with ViewSE, but this procedure won't as it's ViewME specific.
    Sincerely,
    Shawn Tierney,
    Instructor, The Automation School
    Thanks Mr. Shawn. I forgot to state the platform that I am using. I am using ViewSE. Please help me steps on how to set Data Plus in SE. Thanks in advance.
    Bellgast,
    Well, if you are sure you don't want to use the built-in Data Log features of ViewSE you can use the ME DataStore Plus in View SE, but the procedure is different because ViewSE is different.
    If you are familiar with ViewSE, create a screen, add the ActiveX to it, setup MAlso keep in mind that if you are running a client server system, the Best of luck!
    Shawn Tierney,
    Instructor, The Automation School
    PS - If you're not familiar enough with ViewSE to follow the above, you may want to consider my ViewSE course here: https://theautomationschool.com/courses/viewse-basics-course/
    Good Morning Shawn,
    I absolutely love your topics and posts - very informative!
    I'm writing to get more information about choosing DataStore Plus vs Custom Data Storage on my Panelview Plus 7.
    My goal is to log the values of maybe fifteen tags into longterm storage. The data needs to be exportable to a CSV so I'm leaning towards Custom vs Standard for the path. I'm a bit stuck however on whether using Custom Data Storage via a USB or DataStore Plus is the way to go. I thank you for your previous posts,
    https://theautomationblog.com/datastore-plus-step-by-step-setup-in-factorytalk-viewstudio/
    and
    https://theautomationblog.com/how-to-automatically-run-a-usb-flash-drive-script-on-the-panelview-plus/
    I am not sure I completely understand how to set up the script for the USB export, can you describe this another way?
    Can you elaborate more on (1) what, if any, action would need to be done when removing the USB and plugging it back in? Does any process need to be stopped, paused, restarted etc? Can you also describe (2) how much data exactly could be stored on the USB? For example, if I set up a CSV to be made daily, would it do so every day until the USB was filled?
    Again, I can't thank you enough for being such a great resource!
    All the best,
    Carissa Galgano
    Good morning Carissa,
    Sorry I missed your post. I'm sure at this point you've probably found your answers, but for those who come after here's some food for thought:
    1) I've never run into an issue "copying" a CSV file that was actively being written to, and that is what I would suggest you do in your script - copy not move the csv log files to the USB Memory Stick.
    I also add "echo" text to my autorun scripts to let the operator know when the process has started, as well as when it's done to "count to ten" before removing the memory card with the script on it.
    2) The average USB Memory Stick can hold hundreds of thousands of average CSV files. That said, to know for sure if yours will fit, you'll want to log the average amount of data over an average time, and then multiply the resulting file size by the number you need to store on your memory card to determine how big it needs to be.
    Hope this helps,
    Shawn Tierney,
    Instructor at The Automation School
    Hi Shawn,
    I really like your instructions and tutorials.
    I recently went through your PVP course and found it very useful in helping me get a project going.
    I would just like to add, to this ActiveX guide, that when making your RemoteDisplayTag make sure it is in a folder and not the root directory.
    I just spent 2 hours trying to get the above working, and kept getting a grey "No Screen Selected", on bootup.
    A light bulb suddenly came on, back to one of your PVP lessons, about not making tags in the root directory.
    Just wanted to add this in case someone else has issues.
    Good afternoon ,
    Thanks for your comments!
    Which PanelView Plus and ViewStudio version were you using - I'd like to try and replicate the issue here?
    Thanks either way in advance,
    Shawn Tierney,
    Instructor at The Automation School
    Hi Shawn,
    HMI is a 2711P-T7C21D8S running version 9
    FactoryTalk View Studio I am using is version 10.
    Currently I am creating my .mer file to version 9 to work on the HMI.
    Even though we bought them 2 months ago, the HMI may have sat on a shelf for a while.
    Hello Shawn ...
    This is my first time trying to log excel reports from a panelview HMI . After following the step by step guide , I can see .csv files being created in the designated folder when I test run the project with Factory Talk View ME Station emulator . But when I download and run the project in my Panel View Plus Compact 600 HMI - no files are generated . The cat no for HMI is 2711PC-T6C20D8 and the firmware virsion is 8.0.8 . I dont understand what I am missing , please help .
    Thanks and regards ,
    Arvind
    I have created an Active X Data Store Plus app with Factory Talk View ME v10.0., Using a CompactLogix L33 processor running Studio v31.11.
    The csv file downloads to a USB.
    The file contains 5 Barcodes which are scanned from a Keyence Barcode scanner. The issue is this:
    The scanner scans the barcode and the correct barcode is read in the PLC and displayed on the HMI. However, if an barcode ends in a negative digit
    ( 1,3,5,7,9),the data in the csv file drops the negative digit and records it as the next lesser even digit. (0,2,4,6,8)
    Ex Barcode 23198077 reads 23198077 in the PLC and HMI but is recorded as 23198076 in the csv file. All barcodes that end in an even number reads and downloads correctly. Rockwell Tech support is working on the issue
    Any help is greatly appreciated
    Copy of a scan rung is attached
    Thanks
    BB32152
    Good Morning Shawn ,
    I finally got it working with the path "\temp\datalog.csv" . I think my problem was rather stupid - forgetting the closing " symbol . Managed to access the files on a computer using the FTP .
    Thanks very much for the fabulous step by step guide , I may come back with some more questions later .
    Thanks and regards ,
    Arvind
Liked it? Take a second to support Shawn Tierney on Patreon!

139 COMMENTS

  1. I have another curious problem maybe you have some insight on. I have the activeX trigger set to write data only once every 12 hours, only one row. I also have it set to start a new file at specified times and set two times each day, on two separate lines, both a few minutes before the data is captured. However, it seems to have a mind of it’s own about starting the new files. Some days it starts two, some days one, some days not at all and the data is always just added to another row in the last file it created.

    • Good afternoon Danny,

      Sounds like some strange behavior… do you have the DSP ActiveX on a single display that is always running? If so, and the display is set to update at a reasonable rate (twice as fast as the data collection time) and you’re direct referencing tags then what you’re seeing would be quite unexpected!

      Sincerely,

      Shawn Tierney

  2. Yep. All true. I may try two DSP objects on the single display as mentioned in an earlier entry and start two different files each day in that way.

  3. Problem solved. Per knowledge-base answer 731211, the activex will not start a new file if the trigger is not active. Since I was only trying to capture one set of data in 12 hours I didn’t have the trigger active at the specified times.

  4. Hey Shawn,

    I have a difficult application im trying to repair and seek your expert guidance. I having one HMI (panel view plus 1000) communicating to two PLC’s. The tricky part is the PLC’s are working together as a primary and secondary system. Both PLC’s run the same program with all inputs and outputs wired in parallel.

    Question i have for you is;

    Is there a way to setup in the networking settings to assign a primary controller and secondary controller ?

  5. Hi Shawn,

    I have followed all of the steps above, but am having trouble getting the .csv files to be created on my PC. I specified a file location “C:Datadataview.csv”. When I run my panelview program, no .csv file is generated to that file location on my PC. Here is the catch, when I open up my panelview program on FactoryTalk View (on my PC) and open up my Datastore activex screen and press play, it logs the data in the file location. I am working on a PV plus 6 CE.

    Thank you,

    Justin

    • Good morning Justin,

      To me, it sounds like the screen is not opening when the runtime starts.

      I have seen this before when screen control is used via global connections – basically the PLC was telling the PVPlus to display a different screen before the DSP screen could load.

      One quick test would be to change your DSP screen so that it displays in the visible part of your PC screen – that way when you run it on your PC you’ll be sure it is being displayed.

      Please let us know how you make out!

      Sincerely,

      Shawn Tierney

      [stsigcom]

      • Thanks for the reply Shawn. I can see the activex screen pop up briefly when i first start up the panelview, then it goes away as it should. I think my issue is that i am not saving the data on the panelview to an area that i can access with an external PC. I am trying to access the datastore data from an external PC connected to the panelview via Ethernet. I believe i need to set up a network location or FTP server.

        • Good morning again Justin,

          Hmm… from what you describe, it does not sound like the DSP screen is set to “On-Top” and “Cannot be replaced” and therefore it won’t stay open allowing DSP to run and log data (which is what I suspected and why I suggested repositioning it to the visible pixel area of the display.)

          Once it’s staying open and logging, you can change the screen x and y position so it’s off to the side of the viewable area, because it must stay open all the time and On Top and Cannot be replaced is our only option to do so in ViewME.

          As far as storing the CSV files in a location your PC can access, I often store them in the same folder as I set for the FTP server on the PVPlus to share, so that part should work great as long as the WinCE folder path used for the FTP server is the same as you enter into the DSP config.

          Hope this helps,

          Shawn Tierney

          [stsigcom]

  6. Hi shawn

    I used your instructions to log from a PVplus 1500 to my laptop and it worked fine
    will try to log to a server during commissioning

    thanks a lot for your help

    Josh

      • hi shawn

        im trying to log from the panel view to the laptop for final testing, when running test application on my laptop it works fine

        do I have to specify the ip address of my laptop to log back to it?

        • Good morning Josh,

          Sounds like you want the DSP running on the HMI to log to your laptop, right?

          So, DSP can log to a local file path (like C:, or USB Storage)

          It can also log to a remote share, like MyPCsNameMySharedFolder

          However, if you use a share and that share becomes unavailable, DSP won’t be able to log anything.

          Hope this helps!

          PS – Thanks for the coffee(s)!

          Sincerely,

          Shawn Tierney

  7. Hi Shawn,
    I am trying to get DSP to log to my laptop with no luck. The panel keeps telling me invalid file path. The exact syntax I entered into FileLocation on the ME Data Store Plus Properties is “C:LogsDataFileLog.csv” What am I missing?
    Thanks in advance

      • Yes, when I test run it seems to work. When I stop the test run, it does not. Either way, test run or not, I get an alarm on the panel that the file path is invalid. My path names look correct, not protected, etc. The panel does not seem to “see” my PC. Ultimately I want to hook it to our network thru ethernet.
        Thank for the quick reply!

        • Hey Dave,

          So when you test it on your PC, do you get the csv file in C:Logs?

          Once that is working it’s on to the next step.

          The DSP “File Location” parameter can be either a network share or a local directory. C:Logs is a valid local directory on a Windows PC, but it not valid on the Panel which is why the panel gives you this error.

          If you would like the panel to log to your PC over the network, you’ll need to use a network path.

          Start by sharing your C:Logs folder in Windows, and then to check that it is working browse to it from another PC on your network and try to place a file into it to insure you have write access.

          Once you have it working PC to PC, you should know the “path” to that folder

          NOTE: Depending on your network settings, you may be able to use your computer name as part of the path, or you may have to use it’s ip addresses. That goes into DNS, WINS, and other network settings and how you setup the PanelView.

          You may find it easier to have the PanelView log to it’s own local directory which you could serve up using the PV’s FTP or File Sharing services, and then just grab the files from the PV when you want them.

          Hope this helps,

          Shawn Tierney

          [stsigcom]

          • I am at the point where I can see and write to the folder PC to PC using the computer name. Still not working in the panel. In order to use the computer name, how should the panel be setup (as in what network settings)?
            Thanks again

  8. Hi Shawn, just curious. Is it possible to run multiple logs from the Datastore plus? For example, i have 4 elements with different data i would log but would want to log them into their own separate CSV files. Is it as easy as just creating 4 separate data store plus objects within the active X screen and simply give them their own respective data and file locations etc?

    • Shawn was kind enough to help me out with this originally. I have expanded it to do what you are looking for. Just add multiple Data Log components (MEDataStorePlus) to the screen. I currently have 3 going to 3 different csv files, from 2 different PLC’s.

Comments are closed.