Write Atom performance to Excel sheet

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Steffen
Posts: 3
Joined: Tuesday 19 June, 2012 - 16:25

Write Atom performance to Excel sheet

Post by Steffen »

Hey,
need help with a little problem.
I want to write the information about the performance of some atoms to an Excel Sheet.
For example I want to know the maximum content of a queue or the utilization of a server.
Therefore I want to use the “User Events” Atom to measure the Atom`s performance and write the information with help of the “ExcelActiveX” Atom to my Excel Sheet. My input is already read by this ExcelActiveX connection.
But I am not sure about the 4D code.
My idea was:
In the User Events Atom I create a new Event with the name of the Queue.
How do I reference the corresponding atom correct, by AtombyName([Prozessarea]) ??
Which code do I need in the “Edit Event” 4D script?
Thought about: Do(ExcelActiveX_Write(3,6,e3,([Analysis]),([Datasheet])
In which way do I have to reference e3 for the corresponding atom for the information I want to have? By “AtombyName”?
Where are my mistakes.
Hope this explanation makes sense and you guys can help me.
Thanks allot.
MarvinH
Posts: 93
Joined: Tuesday 25 January, 2011 - 11:07
Contact:

Re: Write Atom performance to Excel sheet

Post by MarvinH »

Hello!
Steffen wrote:How do I reference the corresponding atom correct, by AtombyName([Prozessarea]) ??
You can use the input channels of the User Event atom to reference to the particular atom of interest. So connect the first input channel to the central channel of the queue, the involved atom will then be In(1, c).
Steffen wrote:Which code do I need in the “Edit Event” 4D script?
You could indeed use the suggested code. Reference to the atom of interest by using atom reference "i", as you have assigned the involved atom on the previous page by In(1, c). So for example:

Code: Select all

ExcelActiveX_Write(
  3,
  6,
  MaximumContent(i),
  [Analysis],
  In(2, c)
)
Note that I do not know how your Excel atom is called. In case you connect the second input channel of the user event to the central channel of your Excel atom, you can use the code above to write the MaximumContent of the queue to the Analysis sheet of the Excel atom.

Good luck!

Kind regards,

Marvin
Post Reply