Sign in to follow this  
Followers 0
lostcontrol

Writing data to CF Card

16 posts in this topic

Hi, Does anyone use the WRITE CF function of the NS? I have been looking at an application that may require it (if the format can be converted... ), but when trying to use the example above from the manual, it does not even compile, says something about the filename not being correct.. :shrug: Secondly, is there anyway of reading the binary data from the card, and making it legible? Or are we better to look at something else?

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites
yep, have tried that as well, the same error is presented. Bit of an odd one huh...? Edited by lostcontrol

Share this post


Link to post
Share on other sites
Yeah, seems pretty straight forward.... looks like waiting for the one that has successfully used this command... if there is such a person

Share this post


Link to post
Share on other sites
Still is a bit of an anomaly that the manual example does not work... I am not sure how new this function is, whether it is a recent addition..?

Share this post


Link to post
Share on other sites
Works very well. 'READ DATA FROM FLASH CARD. $W39=READCF($W40,10000,$W0,0); 'WRITE DATA TO CF CARD $W39=WRITECF($W40,10000, $W0,0); W0=Filename, W40 first word write W39 gives status feedback. 0 is good. FFFF is not. Yes thats 10,000 words

Share this post


Link to post
Share on other sites
Thanks, James.

Share this post


Link to post
Share on other sites
Hmm, ok that is interesting. I am not sure why it did not compile for me earlier... Either way, it now works, so I can continue testing of this function.

Share this post


Link to post
Share on other sites
Ok, so I tried testing this today, & got a macro error

Share this post


Link to post
Share on other sites
Could this have to do with the system version or CXD version you are running? Perhaps james_applied can post which versions he is running. Still strange though.

Share this post


Link to post
Share on other sites
Is possible I guess, this application us using System Versoin 8.23, which I assume is the latest...?

Share this post


Link to post
Share on other sites
Actually 8.41 is the latest.. check out myomron.com downloads section.

Share this post


Link to post
Share on other sites
ok, I installed v8.41 today and tried the CF write, but still get the same error. The command is almost identical to the one in the manual, so not quite the same as JamesApplied. I will use his exact example next time to see if that makes a difference. Perhaps James could post what versions he is using...? On a plus, the ladder monitorn seems to work now, it did not with the earlier system version.

Share this post


Link to post
Share on other sites
Update. The CFWrite now works!! I am thinking it is something to do with the FileName being in the instruction context, as opposed to being in a $W location... This is what worked for me.. Anyway, can continue with further testing....

Share this post


Link to post
Share on other sites
Well done!!

Share this post


Link to post
Share on other sites

Hi people from 2011,

I am a PLC programmer from 2019... :nana:

Did you find how to read a file using variables $W for the file name instead of constant string? According the manual should be possible, but I am getting -1 as returning value...

Thanks a lot!

Edited by Ctor

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