Sign in to follow this  
Followers 0
Guest Bart M

MelDDE writing problem

8 posts in this topic

OK here is the my project. On a existing melnet network i want to visualise al movement in from a exell. This works fine.(not so dificult) But here is my problem, the manual from beyer shows how to write but in a old macro version. The new exell only uses vba and thats not my speciality I just want to toggle L and M so that cant be difficult but on a runnig system i dont want to play a lot If someone can help me i would be helped a lot because now i have to shut down exell and start gx dev tot toggle (L1003 example) and then restart exell Ok thx

Share this post


Link to post
Share on other sites
Try using the "MX Sheet" add in from Mitsubishi, it is an add in for excel in which you can read and write values direct from your sheet into the cpu. Works on all cpu's in the range

Share this post


Link to post
Share on other sites
I don't have for L and M, but for D: Create button and attach macro: Private Sub CommandButton2_Click() arkChannel = DDEInitiate("melDDE", "Std") DDEPoke arkChannel, "D0,1*2", Range("Sheet1!B2:B3") DDETerminate (arkChannel) End Sub You may also add this: Private Sub Worksheet_Activate() arkChannel = DDEInitiate("melDDE", "Std") End Sub L and M should be similar. Edited by PLC_Cables

Share this post


Link to post
Share on other sites
Yes, PLC Cables' macro will work. Not so long time ago I posted almost identical one here: http://www.eng-tips.com/viewthread.cfm?SQI...PID=791&page=13

Share this post


Link to post
Share on other sites
ok guy´s but in the macro you are writing values from a sheet in a data register but i need to toggle 1 and 0. DDEPoke arkChannel, "L1000,1" to put l1000 on 1 ok ? and DDEPoke arkChannel, "L1000,0" to put l1000 on 0 ok ? i am testing this monday thx

Share this post


Link to post
Share on other sites
Tested with FX0S plc: put 0 to cell c1 put 1 to cell c2 Private Sub CommandButton1_Click() arkChannel = DDEInitiate("melDDE", "Std") DDEPoke arkChannel, "m100", Range("Sheet1!c1") DDETerminate (arkChannel) End Sub Private Sub CommandButton2_Click() arkChannel = DDEInitiate("melDDE", "Std") DDEPoke arkChannel, "m100", Range("Sheet1!c2") DDETerminate (arkChannel) End Sub this will change m100 Edited by PLC_Cables

Share this post


Link to post
Share on other sites
ok i understand now. Monday i wil test it and reply. Have a good weekend, just finisht my shift :-p Thx everybody, this forum rocks our manager knows less and costs more ;) Hmm ; the macro works fine. I was upgrading the exel, tried to work on it the next day and it crasht perment. I cant even open it without enabeling macros Have to redo the whole thing thanx to microsoft Thx everybody for your help and reply's i have a week or two work ;) Edited by Bart M

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0