Sign in to follow this  
Followers 0
aboon78

DDE Manager

3 posts in this topic

Hi, I use DDEInitiate & DDERequest to obtain data from OMRON CJ1M PLC. DDE Manager Version 3.1.1.1 This is the code in Excel VBA: ChannelNumber = Application.DDEInitiate(app:="CDMDDE", topic:="C:\OMRON\Test.cdm") ReturnArray = Application.DDERequest(ChannelNumber, "SS001_TagImage1-1") Application.Worksheets("Sheet1").Range("A1") = ReturnArray Point D4000_001 added in Test.cdm with 64 elements. I want to read 127 words starting from D4000. First, I get the data in array - this what I expect. After a few try, the data is in string. Do you guys know what's going wrong here? Thanks.

Share this post


Link to post
Share on other sites
Not 100% sure with Omron DDE my experience is with AB Product and Excel VB but do you have an Option Explicit declaration at the top of your module? Option Explicit forces VB to fault if a variable is not explicitly defined. Adding this and then defining ReturnArray as an array Integer should help I think. Also if ReturnArray is an array of 64 integers how is it supposed to fit in a range of 1 cell?

Share this post


Link to post
Share on other sites
After surfing few days, finally understand that it's mostly due to the excel DDE functions itself that expect to receive tab delimited. http://www.taltech.com/support/dde_sw/ddeexcel505.htm

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