Arduino traffic lights simulator, part 2

Welcome back.

In the previous part, I showed you how to connect the circuit for the traffic lights simulator.  This time, I’ll show you the sketch to control them.

If you do not have the Arduino software installed already, it can be downloaded from the Arduino website.  You’ll need the Arduino IDE, I have not tested any of this with the Online IDE.

Continue reading “Arduino traffic lights simulator, part 2”

Arduino traffic lights simulator, part 1

This is a great little project for learning about Arduino programming as well as LEDs and resistors.

I’ll show how to build a traffic light simulator on a breadboard and write an Arduino sketch to control it.  This first part is about building the circuit, while the second part will focus on the sketch.

And:  No soldering required.

Parts

You will need the following parts.  I’ve provided links to product description pages, in case you’re not sure what to get.

Continue reading “Arduino traffic lights simulator, part 1”

Failed to initialize the managed interoperability layer

As with most error messages in Dynamics AX, there are many different situations that can result in exactly the same error message.

Start-SmartDeploy : Failed to initialize the managed interoperability layer of Microsoft Dynamics AX.
At C:\Windows\refresh_staging.ps1:403 char:18
+ Start-SmartDeploy <<<< -Configuration Staging
+ CategoryInfo : NotSpecified: (:) [Start-SmartDeploy], Initializ
ationFailedException
+ FullyQualifiedErrorId : Microsoft.Dynamics.BusinessConnectorNet.Initiali
zationFailedException,SmartDeploy.PowerShell.Commands.StartSmartDeployCommand

I have seen quite a few suggested solutions for this particular one, including checking the versions of the .NET framework, .NET Business Connector installed on both the server and the client, using LogonAs() instead of Logon(), but in every single case I have seen this message, the solution has been….. embarrassingly… simple.

It has always been a case of the problem existing between the chair and the keyboard.

Continue reading “Failed to initialize the managed interoperability layer”

Retrieving date/datetime from ADO.NET into a record field

In Dynamics AX, you can use ADO.NET to retrieve data from external data sources.  This is quite easy to do for text and numeric data types, but not for Date or DateTime data types.

If you try a simple assign, you’ll end up throwing an exception:

blocks.Field1 = reader.get_Item( "REGISTRATIONDATE" );

Error executing code: Wrong argument types in variable assignment.

Using SqlDataReader.GetDataTypeName() to check the data type, it shows DateTime2.  The destination field is a datetime field, but this problem as well as the solution happens even for plain date fields.

So, we might try to use SqlDataReader.GetDateTime() instead, but that results in exactly the same error.

Continue reading “Retrieving date/datetime from ADO.NET into a record field”

Importing data to AX from a fillable PDF form

Recently, a requirement came up for importing data from a fillable PDF form into Dynamics AX 2012.  With the right tools, this is actually quite straightforward.

PDF Labs have a product called PDFTK Server, which is a free download.  However, if you need commercial support from them that’s a paid service.  Likewise, if you want to redistribute the software and your software is not licensed under the GPL (Hint, Dynamics AX is most certainly not GPL-licensed…), you’ll need a redistribution license.  The link to the license is here, and the product download is here.

Continue reading “Importing data to AX from a fillable PDF form”