Save priphery address parameters C# function

Find and share HowTos to various installations / configurations!
Search

Post Reply
6 posts • Page 1 of 1
AliBou
Posts: 25
Joined: Wed Mar 28, 2018 1:57 pm

Save priphery address parameters C# function

Post by AliBou » Thu Feb 07, 2019 4:40 pm

Hi,
Is there a C# function to save priphery address parameters ??

Thank you by advance
Best regards

User avatar
leoknipp
Posts: 1591
Joined: Tue Aug 24, 2010 5:28 pm

Re: Save priphery address parameters C# function

Post by leoknipp » Fri Feb 08, 2019 8:32 am

Can you please describe in detail what "save" means?
You can do an ASCII export to save the _address information in a text file.

Best Regards
Leopold Knipp
Senior Support Specialist

AliBou
Posts: 25
Joined: Wed Mar 28, 2018 1:57 pm

Re: Save priphery address parameters C# function

Post by AliBou » Fri Feb 08, 2019 1:50 pm

Hi,
we try to insert pirephery address using C# manager
all these parameters are written successfuly but we have to go in the para and click apply button to save these parameters
our need is function like "paPutGlobalDpc" in para library

thank you by advance
best regards.

User avatar
leoknipp
Posts: 1591
Joined: Tue Aug 24, 2010 5:28 pm

Re: Save priphery address parameters C# function

Post by leoknipp » Fri Feb 08, 2019 3:21 pm

If you want to configure a _address config for a DPE you have to configure the _distrib config first if the driver number is unequal to 1.
Then you can configure it and set the attribute _address.._active as the last step.
Setting is possible with dpSet() commands or the equal function to a dpSet() in a C++/C# API manager.

Best Regards
Leopold Knipp
Senior Support Specialist

AliBou
Posts: 25
Joined: Wed Mar 28, 2018 1:57 pm

Re: Save priphery address parameters C# function

Post by AliBou » Fri Feb 08, 2019 4:16 pm

thank you for your reponse
that's wahat i've done
// String Address configuration
String addType = dpName+ sRootPrefix + ":_address.._type";
String addRef = dpName + sRootPrefix + ":_address.._reference";
String SubInx = dpName + sRootPrefix + ":_address.._subindex";
String addMode = dpName + sRootPrefix + ":_address.._mode";
String dataType = dpName + sRootPrefix + ":_address.._datatype";
String drvIdent = dpName + sRootPrefix + ":_address.._drv_ident";
String AddActv = dpName + sRootPrefix + ":_address.._active";
String direction = dpName + sRootPrefix + ":_address.._direction";
String distDriver = dpName + sRootPrefix + ":_distrib.._driver";
String distType = dpName + sRootPrefix + ":_distrib.._type";
String pollGrp = dpName + sRootPrefix + ":_address.._poll_group";
String driverConnexion = dpName + sRootPrefix + ":_address.._connection";

//DpIdentifiants
var iPollIdf = processModel.GetDpIdentifierByDpPath("_"+Subscription);
var iConnIdf = processModel.GetDpIdentifierByDpPath("_"+ConnectionName);

if (processModel.IsDpPathExisting(dpName) )
{
this instruction dosn't works:
**********************************************************************************
//var distribDriver = new Tuple<string, OaVariant>(distDriver, Convert.ToChar(DriverNumber));
//await valueProcess.SetDpValueAsync(distribDriver);
************************************************************************************

Tuple<String, OaVariant>[] dpCFG ={
new Tuple<string, OaVariant>( distType, 56),
new Tuple<string, OaVariant>( distDriver, Convert.ToChar(DriverNumber)),
new Tuple<string, OaVariant>( addType, 16),
new Tuple< string, OaVariant>( addRef, addressRef),
new Tuple<string, OaVariant>( direction, Convert.ToChar(Direction)),
new Tuple<string, OaVariant>( addMode, Convert.ToChar(2)),
new Tuple< string, OaVariant>( dataType, TConvertHelper.S7PTypeToIntger(type)),
new Tuple<string, OaVariant>( pollGrp,iPollIdf),
new Tuple<string, OaVariant>( drvIdent, "S7PLUS"),
new Tuple<string, OaVariant>( AddActv, false),
new Tuple< string, OaVariant>( driverConnexion, iConnIdf)
};

TraceObj.WriteInfo("+++++++++++++++Insertion Nouvelle Config+++++++++++++++");
await valueProcess.SetDpValueAsync(dpCFG);
TraceObj.WriteInfo("+++++++++++++++Activation Nouvelle Config+++++++++++++++");

var activeAddress = new Tuple<string, OaVariant>(AddActv, true);
await valueProcess.SetDpValueAsync(activeAddress);

AliBou
Posts: 25
Joined: Wed Mar 28, 2018 1:57 pm

Re: Save priphery address parameters C# function

Post by AliBou » Tue Feb 12, 2019 2:43 pm

Hi
when we try to set only _distrib config within driver nmuber it doesn't work ??

string distDriver = dpName + sRootPrefix + ":_distrib.._driver";
var distribDriver = new Tuple<string, OaVariant>(distDriver, Convert.ToChar(DriverNumber))
await valueProcess.SetDpValueAsync(distribDriver);

Post Reply
6 posts • Page 1 of 1