Intouch action script

MLR5000

Member
Join Date
Mar 2013
Location
Fyn
Posts
16
Hi there

I have an action script that sends some number to a cell in excel (r3,c4).

I use the WWPoke command to do this.

Can I write a code so next time the script is activated it input data to (r4,c4).?

I want the data to sends to the next empty cell in that specific row.

If I have to use macros in excel please guide me through the intouch script and the excel macro code.

Best regard
 
Suppose you created a Memory Message tag named "DDEItemNameA".

Then suppose you created a Memory Integer tag named "DDERowNumber".

Suppose that your pushbutton script did this:

IF DDERowNumber < 10 THEN
DDERowNumber = DDERowNumber+1;
ELSE DDERowNumber = 1;
ENDIF;

DDEItemNameA = "r" + DDERowNumber;


That might get you started in the right direction.
 
I got this poke command:

MTag = Text(data,"0");

WWPoke("EXCEL","[Simac.xlsx]Ark1", "r3c3", MTag);

But when I put in your script and error pops up:

"Cannot mix another type with string"

Can you tell what's wrong?
 
But when I put in your script and error pops up:

"Cannot mix another type with string"

Can you tell what's wrong?


I think so. You need to extract the integer value in the "DDERowNumber" tag into a Message tag in order to append the value to the letter "r" in the "DDEItemNameA" tag.

Use the StringFromIntg function to do this. You need to create another Memory Message tag. We'll call it "RowNumber".


So then... On Left Key Down...


IF DDERowNumber < 10 THEN
DDERowNumber = DDERowNumber + 1;
ELSE DDERowNumber = 1;
ENDIF;

RowNumber = StringFromIntg (DDERowNumber,10);

DDEItemNameA = "r" + RowNumber + "c3";

Then use the tag "DDEItemNameA" as the item name in your WWPoke function.


Maybe that will work better? We musn't mix data types! ;)
 
Last edited:
Thanks for your help, I really appreciate that :)

I will try the script later today and post some comments.
 
I works great! Thank you :)

If I run in to more problems I now know which expert to contact ;)

Best regards Martin
 

Similar Topics

Sorry for these basic questions. I'm a traditional structured text programmer who's been asked to take over the PLC and HMI coding here and I'm...
Replies
3
Views
2,869
Trying to export a Modern application for an upgrade to Intouch 2020 but I cannot export the application from the 2014 version because the export...
Replies
2
Views
68
Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
126
Currently we have a fat( I think that is what it is called) Intouch application. An application resolution of 3840x1080, and inside that 2x...
Replies
0
Views
84
Hi guys We're in the process of creating a ME runtime to operate on a PC running windows using a InTouch INDT156 touchscreen, and we're having an...
Replies
3
Views
135
Back
Top Bottom