Author Topic: Simple BasicDataLogger2 Question  (Read 3381 times)

NewControls

  • Newbie
  • *
  • Posts: 11
    • View Profile
Simple BasicDataLogger2 Question
« on: March 02, 2018, 09:32:14 AM »
I am trying to use the BasicDataLogger2 and the only issue i'm having is that i would like to log the data when "WriteOnBitTrue", but where do i define that bit?

Is it in the properties of the BasicDataLogger2 or do i define it somewhere in the form coding?

Thanks!

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #1 on: March 02, 2018, 11:11:26 AM »
Assuming you added your WriteOnBitTrue bit to the collection list, and add a check in your Datachanged event if it is WriteOnBitTrue = 1 then do the action
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

NewControls

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #2 on: March 04, 2018, 12:46:03 PM »
What does the code look like for when you "do the action". I understand making the conditional statement for the action, but i dont know how to define the action.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #3 on: March 04, 2018, 02:19:15 PM »
Attached here are modified BasicDataLogger2 and DataSubscriber2 components.

There is a new PLCAddressWriteOnBitTrue property which allows you to specify the address for the bit.
When this bit goes True then values for all addresses in the PLCAddressValueItems will be logged (a choice of DataChanged or DataReturned values is also included).

You would have to replace both stock components with the attached ones.

The attached log file was created at Runtime, with following Modbus settings:

PLCAddressWriteOnBitTrue = 00001
PLCAddressValueItems = 40001, 40002

If you check the times, the bit 00001 was ON two times for a certain length of seconds while values for both 40001 & 40002 addresses were logged.

Also attached are modified BasicDataLogger and DataSubscriber components, with identical features but for single address.
« Last Edit: March 26, 2018, 05:19:22 PM by Godra »

mrdutx

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #4 on: November 30, 2018, 09:49:41 PM »
Hello Godra,

 I could not find the PLCAddressWriteOnBitTrue property. it only have value property and PLCAddressPauseLogging. I try to trigger the datalogger with bit from plc address.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #5 on: November 30, 2018, 10:51:17 PM »
When you suggest something like that then you should support it with a screenshot similar to the attached and/or provide any and all details that might be relevant.

mrdutx

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #6 on: December 03, 2018, 01:58:13 AM »
i solve it by using the version 3.99y Beta14.
It seem when I drag down the datalogger2 it automatically have ethernetIPforCLXCom1. Because 1st I try to set up the plc but there is no component in toolbox.  This version has the writeOnbit property. Thank you very much.

mrdutx

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #7 on: December 03, 2018, 03:57:28 AM »
I got problem with WriteOnTrigger type, the data to trigger ON is from PLCAddressWriteOnBitTrue?
If using  timeinterval type I can get the log data, but I try to get the data base on plcaddrress trigger. The data is true or false.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #8 on: December 04, 2018, 09:06:27 PM »
You should carefully read reply #3 in this topic.

Also, your LogTriggerType needs to be set to WriteOnBitTrue.

As for your mentioning of the EthernetIPforCLXCom1 driver being added, see this topic:

https://www.advancedhmi.com/forum/index.php?topic=2156.0

Do find some time to spend browsing the forum topics to learn more since any question you might ask could possibly already have an answer posted.

mrdutx

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #9 on: December 04, 2018, 10:44:44 PM »
From reply #3,
if bit on PLCAddressWriteOnBitTrue = True it will write, if PLCAddressWriteOnBitTrue = False it will stop.

how can I  make it log the data in PlcAddressValue by time interval until PLCAddressWriteOnBitTrue  =False.
I try to use LogTriggerType = TimeInterval but it keep loging, even PLCAddressWriteOnBitTrue  = False.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #10 on: December 05, 2018, 08:46:27 PM »
You have to set the LogTriggerType as WriteOnBitTrue if you want to use the PLCAddressWriteOnBitTrue.

The only thing that comes to my mind, related to time interval logging, would be setting the driver's PollRateOverride to the interval you desire and choose the DataReturned value (see the reply #3 again).

mrdutx

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #11 on: December 09, 2018, 08:03:59 PM »
the datalogger is working. I end up making another form that is open when the bit is true, and start logging the data until the bit is failed. so the data logger in new form will start logging using timeinterval when the form is open.


BRX_Noob

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #12 on: December 14, 2018, 03:08:22 PM »
So I have followed the steps for BasicDataLogger2 to WriteOnDataBit using the code you provided. When I set it to this function, nothing is output. I switched to the TimeInterval function and it shows a True/False for when I want the test to run and stop. How do I get it to write only on True? I have the PlcAddressWriteOnBitTure value as 00105, which is the same as the True/False displayed in the log.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #13 on: December 14, 2018, 10:42:35 PM »
Try using the latest 3.99y Beta version of the software and read all the posts in this topic again.

mrdutx

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Simple BasicDataLogger2 Question
« Reply #14 on: December 17, 2018, 08:36:19 PM »
if using plcaddresswriteonbitrue you must change logtrigertype to WriteOnTrigger. this function from my result it will write whenever the bit is true. it write on the time the bit is true.
correct me if im wrong. that is from my result I play with basicdatalogger2. you can try the latest version.