Step7 - Logging user data in ProTool

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
I've been asked to add a few bells and whistles to my old FZR Rossendorf project. Most of it is no real problem, but one thing that I thought would be pretty straightforward is turning out not to be as easy as I thought it would be.

They want to log which user has run each experiment and associate it with a specific project as well as storing all the associated experimental set-up details (which modules, what voltage, energy, etc.).

Using ProTool's built in archiving facililty, most of the technical detail of the experiment is no problem, what I haven't yet fathomed out is how to handle the project and user names. ProTool has a function to store the user name but, unfortunately, it appears that you can't archive Strings!

Does anybody know if there's an easy way round this problem or am I finally going to have to get round to learning Visual Basic - fast, by the end of the week, to be precise!
 
I know that when logging alarms, then the alarm text is also archived.
So, maybe you could make event messages for when the user name changes or the experiment name changes. It is possible to add variables to the messages, but not sure if that includes strings tags.

If it is not possible, then there is some sample code for making VBS archiving which I am sure you can find by searching.
It is not so difficult.
 
OPC looks like it might be the answer

I didn't have much joy finding any sample VBS applications, but on the way it began to look like OPC might be the better way to go.

In the original project (started when I was pretty clueless about Step7) I'd already created a PC-Station for both the main PC HMI and also for the secondary Laptop. For some reason, lost in the mists of time, I didn't build the ProTool program in this PC-Station but directly in the main Station (see attached screen dump). I appear to have managed to add an OPC Server to the PC-Station and in NetConfig I was able to create a connection to the PLC.

Am I right in thinking that that should be enough to fetch data from the PLC? If so how to I actually go about doing that and how do I tell the OPC Server where to store the data on the PC and in what format?

From what I've read so far, I think I should have the components to do what I want without requiring some other program (like Excel) to request the data, or have I missed something there? If I do have everything I need, how do I kick it into doing something?

As far as I can see, it shouldn't matter that the ProTool program is not resident in the PC-Station, since I can get all the data I need directly from the PLC. The fact that ProTool doesn't seem to be saving this data reliably to the PC is a separate problem! ;)

FZR_Config_small.jpg
 
Last edited:
Roy, are we talking about the same problem ?

From your 1st post, I thought that you needed to log when the username is changed and also other strings.

From your 2nd post, now you talk about connecting to the PLC with or without OPC.
Is it because you think that if the data source is via OPC, then there are other datalogging features integrated in Protool RT ?
I am not even sure that strings can be transferred via OPC. I guess so, but I would doublecheck anyway.

I am confused :unsure:
 
Sorry for confusing the issue!

Basically what is wanted is to track the use of the system. Up till now this has been done using a Lab report book, but needless to say, people forget to fill their report out, or fill it out incorrectly (changing parameters after the initial entry and not changing the entry in the Lab book,etc.) The main requirement is accountability of EU funding, which as one might guess is getting stricter all the time.

Since all (or at least most of) the required information is already stored either in the PLC or in ProTool, my original idea was simply to create a User-archive and trigger a transfer of the data to the archive when the User clicked on the Start button. That would have been dead easy and the data could then be opened directly in Excel.

Unfortunately, that idea fell apart when it turned out that ProTool can't archive Strings. While the User names could probably be exchanged for a User number, the EU-project IDs are also alphanumeric, so I'm stuck with at least one String. If you're now saying that OPC also can't handle Strings, then I'm back to square one with a bump and probably back to a VBS script!

I didn't managed to find any examples of a VB scriptdespite a few hours of looking. Do you have any examples or alternatively a link to some?

Alternatively, is there maybe another solution which I've been too blind to see up till now?

Cheers

Roy

Edit: In the meantime, thanks to getting the right text in Google, I've found Volker's VBS FAQ in SPS-Forum.de. It looks pretty good, so I'll sit down and study and then try playing.

Roy
 
Last edited:
Hi Roy.

What you say about strict accountability and EU rules, maybe this is argument for upgrading to WinCC Flexible and using the "audit" option. This one should log all user actions.

I did NOT say that OPC dont work with strings, only that you should check it.
And I do not understand what OPC has to do with this topic.
Are you contemplating using a 3rd party solution for logging values ?

I do believe it can be done by a small script, and I shall try to find something.
The biggest difference beteen WinCC Flex and Protool scripts is that WinCC Flex use the term "Smarttags", which I guess can be stripped out in the Protool script.
 
Hi Jesper, you're right learning VBS scripts doesn't take long, when you've got some simple examples to follow.

I've got the basics working now, the file gets created and appends the data each time a user logs on. Now it's just a question of getting all the data linked which will take a bit of time, purely because of the amount variables they want to save.
 
Now for the next problem - copying the script!

I've now got my script working fine and need to copy it to the ProTool program for the project Laptop. Unfortunately, if I just Ctrl-C, Ctrl-V it from the first Program to the second ProTool proceeds to laydown a new copy of all the Variables used - i.e "Polarity" becomes "Polarity1" etc. Since there are over 50 Variables it'll be a real pain the neck to have to go through and change them all back by hand (not to mention going back and removing them from ProTools Variable list!

Does anybody know if there is a way to copy the script while retaining the original Variables?
 
Easy solution

I eventually tripped over the idea of simply commenting out all the lines with ProTool Variables in them before copying the script. Since there were only about a dozen lines with ProTool Variables in them it was quick and easy to do.

Don't really understand why they want to make a new copy of the Variable in the first place though.:unsure:
 

Similar Topics

This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
142
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
142
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
128
Hi all, I am trying to convert RSLogix 5000 program to Step7. I need to bit shift left my array of double integers for tracking the product on...
Replies
2
Views
520
I have a word in some DB which I want to load to AR1 and use as a pointer. In order to do this I need to write L DBxy.DBW xy SLD 3 LAR1 I...
Replies
3
Views
533
Back
Top Bottom