Guest Bart M Posted October 2, 2003 Report Posted October 2, 2003 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 Quote
navillusi Posted October 2, 2003 Report Posted October 2, 2003 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 Quote
Contr_Conn Posted October 2, 2003 Report Posted October 2, 2003 (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 October 2, 2003 by PLC_Cables Quote
Sergei Troizky Posted October 3, 2003 Report Posted October 3, 2003 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 Quote
Guest Bart M Posted October 3, 2003 Report Posted October 3, 2003 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 Quote
Contr_Conn Posted October 3, 2003 Report Posted October 3, 2003 (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 October 3, 2003 by PLC_Cables Quote
Guest Bart M Posted October 3, 2003 Report Posted October 3, 2003 (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 October 9, 2003 by Bart M Quote
Recommended Posts
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.