cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
cheese_stats
Level II

How do I script to save a .jmp file after Concatenate ?

Hi JMP community,

 

I am trying to make one script button concatenate "PV800_App1_Trend_1_Datalog.csv" with "PLC_DATA_MASTER.jmp" into "CONCATENATED_PLC_DATA.jmp" and then save the concatenated file over the original "PLC_DATA_MASTER.jmp"


The reason is that I have a USB flash drive with industrial PLC data, and this script can automatically update the new data that the PLC logs, and then keep the master file up to date. Everything works, except saving the file. I am even sure that I have dt4 assigned correctly to "CONCATENATED_PLC_DATA" because I have tested close(dt4) but for some reason, any type of script to save the file gives me various error messages.

 

This script gives me

Send Expects Scriptable Object in access or evaluation of 'Send' , dt4 <<  /*###*/save(
	"C:\Users\Jeffrey\Documents\Data Connections\PLC_DATA_TERLOTHERM\PLC_DATA_MASTER.jmp"
) /*###*/

Here is the script. It won't save the concatenated over the master, and gives me the error message above, which I do not understand. Thanks, team.

 

dt2=open("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PLC_DATA_MASTER.jmp"); \\ open master dataset
dt3=open("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PV800_App1_Trend_1_Datalog.csv"); \\ open new dataset
dt3 << Select Where(Time == "Time"); \\ filter out text rows
dt3 << Delete Rows;
column(dt2,"Time")<<data type(Numeric)<<Modeling Type(Continuous)<<Format("hr:m:s", 13, 0)<<Input Format("hr:m:s", 0); \\convert data types
column(dt3,"Time")<<data type(Numeric)<<Modeling Type(Continuous)<<Format("hr:m:s", 13, 0)<<Input Format("hr:m:s", 0);
column(dt3,"Date")<<data type(Numeric)<<Modeling Type(Nominal)<<Format("m/d/y");
column(dt3,"Temp_SETPT")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"Temp_IN")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"Temp_OUT")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"RPM_Pump")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"I_Analog_Pressure_1.Output")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"Power_PCT")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"RPM_HX")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"Glycol_Auto_Position")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"RPM_Agitate")<<data type(Numeric)<<Modeling Type(Continuous);
column(dt3,"Hopper_Level_Pump")<<data type(Numeric)<<Modeling Type(Continuous);
Tables = {}; \\ concatenate
For(i=1, i <= N Table(), i++,
	Insert Into(Tables, Data Table(i)<<get name)
);

For(f2=1, f2<N Items(Tables), f2++,
	ConcTable = Data Table(Tables[f2]) <<Concatenate(Data Table( Tables[f2 + 1] ), Output Table Name( "CONCATENATED_PLC_DATA" ) );
	Close( Data Table( Tables[f2] ), No Save ));
	Wait(1);
current data table(dt2);
close(dt2); \\ close master
dt4=("CONCATENATED_PLC_DATA");
dt4<<save("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PLC_DATA_MASTER.jmp"); \\ save as new master (receives error message)

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How do I script to save a .jmp file after Concatenate ?

I believe your code will work if you change the line

dt4=("CONCATENATED_PLC_DATA");

to

dt4=data table("CONCATENATED_PLC_DATA");
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: How do I script to save a .jmp file after Concatenate ?

I believe your code will work if you change the line

dt4=("CONCATENATED_PLC_DATA");

to

dt4=data table("CONCATENATED_PLC_DATA");
Jim
cheese_stats
Level II

Re: How do I script to save a .jmp file after Concatenate ?

Thanks txnelson !
It works!