Globals.DataLogger1.LogItems(); usage?

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

Globals.DataLogger1.LogItems(); usage?

Post by memethemyn »

Hi..

For an automatic data logging project I must use a rising edge triggered datalogging..

So I want to use this script but always it returned me error..

Would anybody help me to usage of this script.

Code: Select all

Globals.DataLogger1.LogItems();
Thanks..[/b]

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Globals.DataLogger1.LogItems(); usage?

Post by mark.monroe »

You should associate a tag with the datalogger's "Log on Tag event". When that tag's value changes, the datalogger will log data.

HMI's are not fast enough to allow you to log data on "rising edges" or "falling edges". HMI's are not realtime systems therefore there is an arbitrary time lag between when you tell the system to log data and the system actually logs data. Plus, the HMI can only poll tags at a maximum rate of 20-100 ms. Which means that the data that you are logging is not the exact data that is in the memory address of the controller.
Snap 2012-11-01 at 07.57.01.jpg
Snap 2012-11-01 at 07.57.01.jpg (36.21 KiB) Viewed 14939 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

Re: Globals.DataLogger1.LogItems(); usage?

Post by memethemyn »

Ok..

First thanks for your information but I dont want to log data very fast.. I only want to log data in some variable conditions..

For example in the system I want to log in this situations..

1. situation:

Log on Tag5

2. situation:
log on tag6 when tag4's value is 1

then I try to write codes because in scripting it will be very simple but I didin't find the code to log once into datalogger1..

I hope to tell myself :(

PS: I try to use expressions.. But didnt work..
Attachments
dtalogger expressions.PNG
dtalogger expressions.PNG (188 KiB) Viewed 14936 times

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Globals.DataLogger1.LogItems(); usage?

Post by mark.monroe »

To log once, just change the value of the tag associated with the "Log on Tag event". Everytime that tag's value is changed, it will log once and only once.

Only change that tag's value when you want it to log. Change the value of that tag in your script. Write a set of if statements and in those if statements decide whether or not to change the tag associated with the "Log on Tag event".

Rather than calling a function to force the data logger to log, you change the value of tag associated with the "Log on Tag event". You can add 1 to that tag for example.

If you follow my previous post, it will do exactly what you want.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

Re: Globals.DataLogger1.LogItems(); usage?

Post by memethemyn »

ok..

so the datalogger logs when the tag goes to set and logs again when goes to reset..

Here is a database export file.. When I try to Log on event the logger takes two values..

some of logs which I desired and some of logs that I dont desire.

It is very bad not to use logOnce in script :(
Attachments
testdatalogger.xls
(24 KiB) Downloaded 727 times

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Globals.DataLogger1.LogItems(); usage?

Post by mark.monroe »

The logger logs when the value of the tag associated with the "log on tag event" changes value. Any change causes it to log. You can therefore add 1 to the tag and every time 1 is added, it will log.

From your data I can not tell whether or not it is logging twice. Please use a tag to trigger your logger that is an int and then log that tag's value along with the other data you are logging.

If it logs twice you will see the tag associated with the "log on tag event" with the same number twice.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

Re: Globals.DataLogger1.LogItems(); usage?

Post by memethemyn »

so when I will use an analog value in "Log on tag event" the problem will be solved.. is it true ?

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Globals.DataLogger1.LogItems(); usage?

Post by mark.monroe »

From your excel document, I can not tell whether the datalogger is logging twice or not. You could simply have a bug in your program where you mistakenly tell the datalogger to log twice.

You need to show me evidence that the datalogger is actually logging data twice when you change the "log on event" tag only once.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

Re: Globals.DataLogger1.LogItems(); usage?

Post by memethemyn »

Dear Mark..

I created a tag as named "LOGCounter" as int16. So when the situaitons happened I increase the Logcounter. The mistake ı made I only think the log on event as a bit..

Thank for your helps..

jcjelektro
Posts: 40
Joined: Tue Nov 22, 2011 3:54 am
Location: Gjerlev, Denmark
Contact:

Re: Globals.DataLogger1.LogItems(); usage?

Post by jcjelektro »

Hello

I have the same problem with 2 log entry's when i logged from a button.
I have a simple solution for that.

Go to Tags, Select the tag you want to use. Fx. "TAG3"
Select Action, Then add a condition Fx. (==1), and then Add the Action, Datalogger, Log ONCE, then select the Datalogger you want to log.
datalogger.png
datalogger.png (245.68 KiB) Viewed 14876 times
In the datalogger set it to Log in Tag event, But use another tag, there is not used, and not will be used! Fx. "not_used"
datalogger2.png
datalogger2.png (193.41 KiB) Viewed 14876 times
Forget about start /stop logging, it will work this way, so you only log once, each time you press the button/tag is =1.

- Emil
--
Emil Gundersen
JCJelektro.dk

Post Reply