AngryRobot Posted August 28, 2019 Report Posted August 28, 2019 What is the best way to get data from an NX102 (or any NJ/NX PLC) into Excel? I've been experimenting with some OPC UA options, but so far the only clients I've been able to connect with don't allow exporting of data. Does Omron have any sort of ODBA connection? Quote
Michael Walsh Posted August 28, 2019 Report Posted August 28, 2019 Write a .csv file onto the SD card and then use FTP to get it off the card. That is one pretty easy way. 1 Quote
IO_Rack Posted August 29, 2019 Report Posted August 29, 2019 Michael suggests the easiest way. If you (or customer) wants extended capabilities, there are some NX and NJ models that can connect to DB servers. https://assets.omron.eu/downloads/manual/en/v3/w527_nj-series_database_connection_cpu_units_users_manual_en.pdf 1 Quote
AngryRobot Posted August 29, 2019 Author Report Posted August 29, 2019 I've used the NJ models with SQL capabilities before, but this machine doesn't normally require data logging. We are wanting to do an in-house run off on the machine and log some of the test results to prove its reputability when our customer shows up; and I figure logging it right from the PLC will be easier than sitting at the machine and manually recording every number by hand then transcribing it into Excel. So FTP it is. Quote
AngryRobot Posted August 29, 2019 Author Report Posted August 29, 2019 (edited) Any tips on how to write data to the CSV file? I have an array of REAL numbers. I can create and close the file just fine, but the data that gets written is just junk characters. Do I need to convert the data to string? EDIT: Converting to string and concatenating a ',' worked. Edited August 29, 2019 by AngryRobot 2 Quote
IO_Rack Posted August 30, 2019 Report Posted August 30, 2019 This may be slightly more complex than what you are looking for but here is what I have. This will write a CSV file populated from a 2 dimensional array of REALs (16x16). In this particular example, the "Unit_Str" is specific to our application. I also run it twice with the "Light_Check_SeqStep_xx_Active" sequence step bits but only once is necessary. I copied this code over from a working program but I haven't tested this one. SD_Card_Write_Example.smc2 1 Quote
PMCR Posted September 6, 2019 Report Posted September 6, 2019 2 other options to write to the SD card. http://forums.mrplc.com/index.php?/files/file/1152-nx-or-nj-data-logging-function-block/http://forums.mrplc.com/index.php?/files/file/1151-nx-or-nj-variable-historian/ Quote
PenneyInstruments Posted January 13, 2021 Report Posted January 13, 2021 On 9/6/2019 at 10:51 AM, PMCR said: 2 other options to write to the SD card. http://forums.mrplc.com/index.php?/files/file/1152-nx-or-nj-data-logging-function-block/http://forums.mrplc.com/index.php?/files/file/1151-nx-or-nj-variable-historian/ Hi PMCR, Can I have multiple instances of these function blocks to write to the same SD card so it creates different files? I would like to log equipment downtime in seperate files. Also, does your LogDataX variables within the structure support Time data type? Thanks Quote
PMCR Posted January 13, 2021 Report Posted January 13, 2021 Multiple instances should be OK. I use the status flags for SD card access in the FB. Quote
PrecisionPLC Posted April 16, 2021 Report Posted April 16, 2021 On 28/08/2019 at 10:30 PM, Michael Walsh said: Write a .csv file onto the SD card and then use FTP to get it off the card. That is one pretty easy way. Hi Michael, Can you provide more info on how to do this? i have 14 arrays of 18 Dint, every hour data is recorded in these arrays i want to be able to send the data in these arrays at the end of shift before there get blanked thanks Quote
Michael Walsh Posted April 16, 2021 Report Posted April 16, 2021 Here is sample code on how to write to a csv. You will need to create a login on the site to get to the file if you have not already done so. https://automation.omron.com/en/us/support/resources/sample-code/sd-card-write-sample-code-in-njnx-controller Here is a video that explains how to FTP the file from the SD card: https://www.youtube.com/watch?v=a1d81yiaHu0 Quote
BRJPATEL Posted May 17, 2021 Report Posted May 17, 2021 On 8/28/2019 at 5:30 PM, Michael Walsh said: Write a .csv file onto the SD card and then use FTP to get it off the card. That is one pretty easy way. Hello Michael, I am new in this field. But I want to take data in .csv file into SD card. How can i create .csv file that can directly trace data of my program? Please help me out. Thanks Quote
Crossbow Posted May 18, 2021 Report Posted May 18, 2021 He already provided a link explaining how to save controller data to CSV file. 1 Quote
man31 Posted October 13, 2021 Report Posted October 13, 2021 Hello everybody! For all the above links you have provided, I get the following error from Sysmac Studio. Is there any way skip that error? Is any pdf file available for the above links, for writing data to SD card? Thanks Quote
IO_Rack Posted October 13, 2021 Report Posted October 13, 2021 (edited) I'm not familiar with the limited SS version. What is your PLC model that it allows you to open? Edited October 13, 2021 by IO_Rack Quote
man31 Posted October 13, 2021 Report Posted October 13, 2021 1 hour ago, IO_Rack said: I'm not familiar with the limited SS version. What is your PLC model that it allows you to open? I'm using the NX1P2-9B24DT controller. Is this an issue with the controller or with the license? I tried also OMRON site to download some samples but none of it opend.. Thanks for the pdf file! Quote
IO_Rack Posted October 13, 2021 Report Posted October 13, 2021 I'm assuming you have a limited license for Sysmac Studio. The project file I posted used an NJ501 controller. Quote
photovoltaic Posted October 14, 2021 Report Posted October 14, 2021 You must have the light version. If you can't write your own from the PDF let me know and I can convert an example to an NX1P Quote
man31 Posted October 14, 2021 Report Posted October 14, 2021 1 hour ago, photovoltaic said: You must have the light version. If you can't write your own from the PDF let me know and I can convert an example to an NX1P Yes I have the light version, unfortunately.. So I suppose this version is only for NX controllers..? I'm going to give it a try of writing my own and I will let you know. Thanks a lot! Quote
Crossbow Posted October 14, 2021 Report Posted October 14, 2021 Sysmac Studio Lite is only for NJ101 and NX1P2. Quote
PMCR Posted October 14, 2021 Report Posted October 14, 2021 Lite also supports NX102 CPUs. The 'Full' version adds support for NJ301, NJ501, and NX701. I have attached a version compiled for NX102, firmware version 1.32, which is an old version of firmware that older versions of Sysmac Studio can open. NJ Data Log Function NX102.smc2 Quote
man31 Posted October 15, 2021 Report Posted October 15, 2021 11 hours ago, PMCR said: Lite also supports NX102 CPUs. The 'Full' version adds support for NJ301, NJ501, and NX701. I have attached a version compiled for NX102, firmware version 1.32, which is an old version of firmware that older versions of Sysmac Studio can open. NJ Data Log Function NX102.smc2 I managed to open the project. thanks a lot!! Quote
Crossbow Posted October 15, 2021 Report Posted October 15, 2021 17 hours ago, PMCR said: Lite also supports NX102 CPUs. The 'Full' version adds support for NJ301, NJ501, and NX701. I have attached a version compiled for NX102, firmware version 1.32, which is an old version of firmware that older versions of Sysmac Studio can open. NJ Data Log Function NX102.smc2 The only document I could find on Lite indicated only NX1P2 and NJ101. Would be nice if it was better documented. Quote
man31 Posted October 18, 2021 Report Posted October 18, 2021 Hello again! As per IO_Rack and PMCR latest attachments, I understand that the writing of headers is for first cell only in each line of csv file, i.e A1,A2,A3 and so on. What I'm trying to do is to add headers in each column for the first line (this is going to be fixed) and then, rest of lines will be filled with the respective data, coming from an array of structures, for a number of 50 lines in csv file. So, lets say that the array of structure (array#1) consist of data of a structure (myStructure1) with 6 members in total. Final csv should be as follows: Line 1: Headers (6 columns) Line 2: Data of array#1 (column1=member1, column2=member2, column3=member3 etc.) Line 3: Data of array#1 (column1=member1, column2=member2, column3=member3 etc.) Line 50: Data of array#1 (column1=member1, column2=member2, column3=member3 etc.) My problem is: 1) I cannot find a way (or I don't understand the way) of adding headers in different columns 2) I cannot insert each value of member in separate cell (column). I assume that I could use concat instruction for 6 members separately but I believe there is a more optimal and effective way instead of it. Even if I use the FileWrite instruction (usage also for array of structures), the values from the array of structures are going to the first cell only. In addition, I cannot find a way of inserting the values to a specific cell. I tried also to move the array of structures in to a new array and then move the new array to csv file but, the problem with this option is that movement can be done only with the same data types.. Any suggestion please? Hope my points were clear.. Thanks 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.