I'm new in OPC-UA. I looked into the reference SDK and some online tutorial.
I'm creating a OPC-UA server for a simulation of an industrial machine.
I created my xml model with some motors and sensors. They both have an AnalogItemType variable.
I'm taking the motor in example:
<opc:ObjectType SymbolicName="Motor" BaseType="ua:BaseObjectType">
<opc:Description>A motor.</opc:Description>
<opc:Children>
<opc:Variable SymbolicName="Speed" DataType="ua:Double" ValueRank="Scalar" TypeDefinition="ua:AnalogItemType" AccessLevel="ReadWrite" />
<opc:Method SymbolicName="Start" ModellingRule="Mandatory"></opc:Method>
<opc:Method SymbolicName="Stop" ModellingRule="Mandatory"></opc:Method>
</opc:Children>
</opc:ObjectType>
I use the UA.ModelCompiler (from OPC-UA Foundation) to compile the xml and generate the code for the server.
I use the Reference client in the Reference SDK.
When I run my server, I can see only the EURange property of the AnalogItem and not the EngineeringUnits (both should be optional and not mandatory).
I tried to set both in my NodeManager.cs :
Server.Motor.Speed.EURange.Value = new Opc.Ua.Range() {Hingh = 900, Low = 100};
Server.Motor.Speed.EngineeringUnits.Value = new EUInformation("rad", "radiants", "http://www.opcfoundation.org/UA/units/un/cefact");
The first instruction is ok but the second throws an exception because, it says, the EngineeringUnits is null (while the EURange is of type [Variable]EURange).
How can I set the EngineeringUnits (and maybe diable EURange) in my C# code?
How can I enable the EngineeringUnits (and maybe diable EURange) in the MyModelDesign.xml?
I have a simple SharpMap Map object (WinForms) which contains a TileAsyncLayer (OpenStreetMap using BruTile) within the BackgroundLayers collection.
I would like to have the map either wrap at the edges or repeat so that the user can fan continuously east/west without ever reaching the "end" of the map, but there doesn't seem to be a built in option to do this. What would be the simplest way to enable infinite scrolling?
My code:
BruTile.Web.HttpTileSource source = KnownTileSources.Create();
TileAsyncLayer background = new TileAsyncLayer(source, "OSM");
mapBox1.Map.BackgroundLayer.Add(background);
mapBox1.Map.ZoomToExtents();
mapBox1.Refresh();
mapBox1.ActiveTool = MapBox.Tools.Pan;
Software Versions:
SharpMap: 1.2.0-pre.182830673
BruTile: 2.1.2
I am trying to upgrade my application from FME2009 to FME2015. The problem I'm running into is it seems like the parameters I set are not being used in the actual transformer. Instead, the default values from the transformer definition are being used. Specifically, the source and destination coordinate system names are not being applied.
Setting the parameters in this way worked perfectly when my application was linked against FME2009.
Code excerpt:
StringCollection directives = new StringCollection();
directives.Add(Safe.FMEObjects.Constants.TransformerManager.CreateTransformerDirectives.SerializationString);
parameters = String.Format("\"SOURCE_COORDSYS,{0},XFORMER_NAME,SpineClipTransformer,DEST_COORDSYS,{1}\"", sourceCSys, destCSys);
directives.Add(String.Format("NAME,SpineClipTransformer,VERSION,0,PARAMETER_VALUES,{0},INPUT_FEATURE_TYPES,,INPUT_FILTERS,,INPUT_ATTRS,,OUTPUT_FEATURE_TYPES,,OUTPUT_FUNCTIONS,", parameters));
transformer = fme.TransformerManager().CreateTransformer(directives);
When I execute this code I can see from the logs that the default values are being used.
Log excerpt:
Coordinate system named TOM_PRICE_MINE_MGA does not exist.
BADNEWS: No definition was found for coordinate system `TOM_PRICE_MINE_MGA(TOM_PRICE_MINE_MGA)' (crdsysmn.cpp:1074)
Coordinate system named TOM_PRICE_MINE_MGA does not exist.
BADNEWS: Unknown coordinate system 'TOM_PRICE_MINE_MGA' specified - aborting (crdsysmn.cpp:1628)
Unknown coordinate system 'TOM_PRICE_MINE_MGA' specified - aborting
BADNEWS: Reprojector: Could not create reprojection engine (fmereprojector.cpp:404)
Reprojector: Could not create reprojection engine
Transformer excerpt:
<GLOBAL_PARAMETERS>
<GLOBAL_PARAMETER
GUI_LINE="GUI COORDSYS DEST_COORDSYS Destination Coordinate System:"
DEFAULT_VALUE="EPSG:28350"
IS_STAND_ALONE="false"
/>
<GLOBAL_PARAMETER
GUI_LINE="GUI COORDSYS SOURCE_COORDSYS Source Coordinate System:"
DEFAULT_VALUE="TOM_PRICE_MINE_MGA"
IS_STAND_ALONE="false"
/>
</GLOBAL_PARAMETERS>
...
DEFAULT_MACRO DEST_COORDSYS EPSG:28350
DEFAULT_MACRO SOURCE_COORDSYS TOM_PRICE_MINE_MGA
Edit 1
I found the IFMEOTransformer.Serialize method and ran it after I instantiated the transformer.
My directive: NAME,SpineClipTransformer,VERSION,0,PARAMETER_VALUES,"SOURCE_COORDSYS,LL-GDA94,XFORMER_NAME,SpineClipTransformer,DEST_COORDSYS,MGA94-50",INPUT_FEATURE_TYPES,,INPUT_FILTERS,,INPUT_ATTRS,,OUTPUT_FEATURE_TYPES,,OUTPUT_FUNCTIONS,
IFMEOTransformer.Serialize() output: NAME,SpineClipTransformer,VERSION,1,PARAMETER_VALUES,"__COMPOUND_PARAMETERS,,XFORMER_NAME,SpineClipTransformer,TRANSFORMER_GROUP,",INPUT_FEATURE_TYPES,,INPUT_FILTERS,,INPUT_ATTRS,,OUTPUT_FEATURE_TYPES,,OUTPUT_FUNCTIONS,
Attempting to follow this format (without knowing anything about it), I changed my directive to: NAME,SpineClipTransformer,VERSION,1,PARAMETER_VALUES,"__COMPOUND_PARAMETERS,SOURCE_COORDSYS,LL-GDA94,XFORMER_NAME,SpineClipTransformer,DEST_COORDSYS,MGA94-50,TRANSFORMER_GROUP,",INPUT_FEATURE_TYPES,,INPUT_FILTERS,,INPUT_ATTRS,,OUTPUT_FEATURE_TYPES,,OUTPUT_FUNCTIONS,
New IFMEOTransformer.Serialize() output: NAME,SpineClipTransformer,VERSION,1,PARAMETER_VALUES,"__COMPOUND_PARAMETERS,SOURCE_COORDSYS,XFORMER_NAME,SpineClipTransformer,TRANSFORMER_GROUP,",INPUT_FEATURE_TYPES,,INPUT_FILTERS,,INPUT_ATTRS,,OUTPUT_FEATURE_TYPES,,OUTPUT_FUNCTIONS,
The host property of a familyInstance returns a RevitLinkInstance when the host is placed within a linked document. I there a way to get the real Element (or its ID) instead of the RevitLinkInstance?
I was hoping that the stableREpresentation could give me more information, but unfortunatly, it doesn't.
Reference hostFaceReference = instance.HostFace;
string stableRepresentation = hostFaceReference.ConvertToStableRepresentation(instance.Document);
this would give "ac669fa6-4686-4f47-b1d0-5d7de6a40550-000a6a4a:0:RVTLINK:234297:0:218" where 234297 is the ID of the referenced element, in this case, still the RevitLinkInstance.
Have you tried this?
ElementId hostFaceReferenceId = instance.HostFace.LinkedElementId;
You could then try getting the Element via the linkedDocument.
Document LinkedDoc = RevitLinkInstance01.GetLinkDocument();
Element linkedEl = LinkedDoc.GetElement(hostFaceReferenceId);
Depending on the host you may have to go about it a few ways. For example, with a wall you could try the following (this is using LINQ by the way):
// filter the Host's document's items
FilteredElementCollector linkdocfec = new FilteredElementCollector(elem_inst.Host.Document);
// establish the host's type
linkdocfec.OfClass(elem_inst.Host.GetType());
// find the host in the list by comparing the UNIQUEIDS
Element hostwallinlinkedfile = (from posshost in linkdocfec
where posshost.UniqueId.ToString().Equals(elem_inst.Host.UniqueId.ToString())
select posshost).First();
// check the different faces of the host (wall in this case) and select the exterior one
Reference linkrefface = HostObjectUtils.GetSideFaces((hostwallinlinkedfile as HostObject), ShellLayerType.Exterior).First<Reference>();
// create a reference to the linked face in the the CURRENT document (not the linked document)
Reference linkref = linkrefface.CreateLinkReference(rvtlink_other);
Ultimately, according to the docs anyway, you're supposed to utilize the CreateReferenceInLink method to get your item.
I started with the solution here http://social.technet.microsoft.com/wiki/contents/articles/20547.biztalk-server-dynamic-schema-resolver-real-scenario.aspx
which matches my scenario perfectly except for the send port, but that isn't necessary. I need the receive port to choose the file and apply a schema to disassemble. From their the orchestration does the mapping, some of it custom, etc.
I've done everything in the tutorial but I keep getting the following error.
"There was a failure executing the receive pipeline... The body part is NULL"
The things I don't get from the tutorial but don't believe they should be an issue are:
I created a new solution and project to make the custompipeline component (reference figure 19) and thus the dll file. Meaning it is on it's own namespace. However, it looks like from the tutorial they created the project within the main biztalk solution (ie the one with the pipeline and the orchestration) and thus the namespace has "TechNetWiki.SchemaResolver." in it. Should I make the custompipeline component have the namespace of my main solution? I'm assuming this shouldn't matter because I should be able to use this component in other solutions as it is meant to be generic to the business rules that are associated with the biztalk application.
The other piece I don't have is Figure 15 under the "THEN Action" they have it equal the destination schema they would like to disassemble to but then they put #Src1 at the end of "http://TechNetWiki.SchemaResolver.Schemas.SRC1_FF#Src1". What is the #Src1 for?
In the sample you've linked to, the probe method of the pipeline component is pushing the first 4 characters from the filename into a typed message that is then passed into the rules engine. Its those 4 characters that match the "SRC1" in the example.
string srcFileName = pInMsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties This link is external to TechNet Wiki. It will open in a new window. ").ToString();
srcFileName = Path.GetFileName(srcFileName);
//Substring the first four digits to take source code to use to call BRE API
string customerCode = srcFileName.Substring(0, 4);
//create an instance of the XML object
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(string.Format(#"<ns0:Root xmlns:ns0='http://TechNetWiki.SchemaResolver.Schemas.SchemaResolverBRE This link is external to TechNet Wiki. It will open in a new window. '>
<SrcCode>{0}</SrcCode>
<MessageType></MessageType>
</ns0:Root>", customerCode));
//retreive source code in case in our cache dictionary
if (cachedSources.ContainsKey(customerCode))
{
messageType = cachedSources[customerCode];
}
else
{
TypedXmlDocument typedXmlDocument = new TypedXmlDocument("TechNetWiki.SchemaResolver.Schemas.SchemaResolverBRE", xmlDoc);
Microsoft.RuleEngine.Policy policy = new Microsoft.RuleEngine.Policy("SchemaResolverPolicy");
policy.Execute(typedXmlDocument);
So the matching rule is based on the 1st 4 characters of the filename. If one isn't matched, the probe returns a false - i.e. unrecognised.
The final part is that the message type is pushed into the returned message - this is made up of the namespace and the root schema node with a # separator - so your #src1 is the root node.
You need to implement IProbeMessage near to class
I forgot to add IProbeMessage in the code of article. It is updated now.
but it is there in sample source code
Src1 is the the root node name of schema. I mentioned that in article that message type is TargetNamespace#Root
I recommend to download the sample code
I hope this will help you