Sign in to follow this  
Followers 0
f3dps2

Data Logging Using NS Screen, CJ1M and NS-Runtime

3 posts in this topic

Hello everyone, I've been searching the web for a while and haven't been able to find an answer to my question: I have a CJ1M PLC recording power figures to data memory (starting at D2000) using WSFT when an I/O pulse happens every 15 minutes. It records 96 values (corresponding to one day), and then I XFER the data to other blocks (D2100 etc) until I have an entire month's worth of values. I want to be able to export the values in this large data memory field (approx 3000 addresses) to a spreadsheet stored on a computer (not a memory card). The computer and PLC are connected via ethernet. I am operating the PLC by means of NS-Runtime, and although CX-Designer has a lot of functions that sound like what I want, I can't figure out how to achieve my goal. For example, the multifunction button with the data block command 'save PLC data block to CSV' sounds perfect, but I'm unsure how to create this data block. For each field it asks you for a data memory address, and then allows multiple records. I basically want the export to have D2000-D2096 in column A, D2100-D2196 in column B, etc etc. I know I could possibly achieve my goal by just using the data log function in CX-Designer and exporting from internal memory, but having the readings backed up in the PLC and separated into discrete days and weeks is hugely beneficial for this application. Is anyone able to help? Much appreciated.

Share this post


Link to post
Share on other sites
Ok so given enough time alone with my thoughts, I've managed to solve my own problem, and here's how: --I've streamlined the display to only need 100 memory addresses displayed, selectable by indirect addressing in the PLC. 100 is easier to deal with than 3000.-- Set up two push buttons with macros. The first one goes: READHOSTW($W100, [HOSTNAME], 300, 5900, 100); 'where $W100 = Destination memory address (Internal screen memory), [HOSTNAME] = ethernet host PLC, 300 = macro code for DM memory area, 5900 = Starting memory address in PLC, 100 = number of words to copy This copies 100 words from D5900 in the host PLC into $W100 - $W199. The second macro button goes: WRITECF($W100, 100, "PWRLOG.BIN" ,0); 'where $W100 = Starting source word, 100 = number of records to save, "PWRLOG.BIN" = filename to save to, 0 = just zero because omron likes it that way This saves 100 words from $W100-$W199 into a binary format file and saves it to the 'memory card.' (NS-Runtime uses the computer's hard disk as the memory card so it's all fun and games).

Share this post


Link to post
Share on other sites
I do however have another couple of questions (easier this time): Is it possible to add the current time/date (short form) to the output file name string for the WRITECF macro each time the button is pressed? (To create a new unique file each time the button is pressed instead of overwriting and replacing) Example: at 10:34AM 5th August 2014 the button is pressed and a file "PWRLOG-1034-050814.BIN" is created. ALSO Does anyone know of a simple way to convert binary format files into CSV format files without having a dedicated converter with its own GUI? Looking for something I can use basically as a command line execution. Endgame: I want to be able to import this information into excel without a lot of stuffing around. Thanks.

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