Jump to content

MelDDE writing problem


Recommended Posts

Guest Bart M
Posted
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

Posted
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
Posted (edited)
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
Guest Bart M
Posted
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
Posted (edited)
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
Guest Bart M
Posted (edited)
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...