Jump to content
OMRON Forums

PCommServer - Any API to backup whole PMAC?


Sanjay

Recommended Posts

  • 1 month later...
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Are there any API calls in the PCommServer library that can do the equivalent of the Backup PMAC functions in the PeWin32Pro software so that we can integrate that into our application?

 

I'd like to know this as well. We use the PMAC Panel Pro toolkit for LabVIEW (I realize it is deprecated :P ), and so far the only way I've found to do this is to manually dump motion programs, dump PLCs, dump all the variables group by group, and dump all the coordinate system definitions into a file (we don't use the comp tables, etc). It would be nice if the library already had a function which handles this.

 

I studied the ActiveX library at one point and I didn't see a function for this there either. Perhaps PCommServer2 has something for this? We don't have it yet.

Link to comment
Share on other sites

  • 1 month later...

See the section "UPLOAD PMAC CONFIGURATION" in the PcommServer manual.

 

Perhaps there's a newer version of the PcommServer manual out that I'm not aware of as there's no section like that in my manual.

 

Can you let us know what is revision date of latest PcommServer manual?

I don't see any revision # on my version but there's 108 total pages.

Link to comment
Share on other sites

This is example of what I think you need.

Below just uploads Ivars to a single string then puts them into an array.

But same function will upload any, all you want.

 

//note this struct is part of "namespace PCOMMSERVERLib "

public struct DEVUPLOAD

{

public short comp_tables;

public short coord_sys;

public short important_register;

public short ivar;

public short macro;

public short motion;

public short mvar;

public short option_16;

public short option_16e;

public short plc;

public short plcc;

public short pvar;

public short qvar;

public short racro_ring_order;

public short single_backup;

public short user_backup;

}

 

string pmacIvarsUpload = String.Empty;

int pstatus = 0;

DEVUPLOAD pUpload = new DEVUPLOAD();

pUpload.ivar = 1;

 

try

{

classPComm.Pmac.Upload(classPComm.DeviceNum, pUpload, out pmacIvarsUpload, out pstatus);

}

catch

{

string errMsg = pstatus.ToString();

}

 

 

//here this logic will parse the above string to an array with EACH element contains a single Ivar...

//here we will process the string data from the Ivar upload

//-we will create a string array with all the Ivars parsed from the uploaded string

//-we will also get the string array index to I0 then we can step thru the rest

//here we create a temp working string and remove all ";" from the uploaded string

string workingString = String.Empty;

workingString = GVars.ivarsUpload.Replace(";", "");

//now we setup to use the SPLIT command which will parse the string data to an array

char[] delimiterChars = { 'I', ' ', '\n', '\r' };

string[] ivars = workingString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);

//now find index for I0, if (1st-2-chars != "0=") not I0

for (int i = 0; i != -1; i++)

{

//first need to check and be sure we not at end of array

// if we are there was a problem getting ivars from pmac

if (i < ivars.Count())

{

//here ok to keep checking

if (ivars.StartsWith("0="))

{

GVars.indexI0 = i;

i = -2;

}

}

else

{

//here if a problem, the array must not have ALL ivars

// in it - this is a comm problem with pmac

//0103=Failed to Load Parameters\n - Close Software, Shutdown PMAC, Reboot Computer,\n Try Again

XtraMessageBox.Show(GVars.rm.GetString("0103"), "Error 1368", MessageBoxButtons.OK, MessageBoxIcon.Error);

return false;

}

}

//now we have clean array of ivars starting at the GVars.indexI0 we can load to an ArrayList

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...