NI Home > Community > NI Discussion Forums
Reply
Member
Daniel_E
Posts: 123

Re: Simple Machine Control Reference Application

Excellent!  Thanks for the additional information of needing to create the Data directory.  I missed that one.

 

If you look in the original XML file, I had a few CIE tags with "_Temporary" in the name.  These were used to pass up simulated data from the CompactRIO FPGA to the Scan Engine using User Variables.  These tags were then scaled and written to CVT tags that were used throughout the rest of the program (ie. Output_Temporary CIE tag would be written to the CVT tag Output).  Now that we are using real IO, we don't need these place holder tags so as a specific example, I deleted the Output CVT tag, renamed the Output_Temporary CIE tag to Output, changed the data type to be double and changed the Address path to match my real IO (mod5\AI5). 

 

I hope this helps!

Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control
Member
Steve Sexton
Posts: 11
0 Kudos

Re: Simple Machine Control Reference Application

Does the IO Scan engine read and write the analog directly or does it use the setting set in the Multiple Variable Editor?  In other words, do I need to write my own VI that uses temporary tags to scale and calibrate the AI and AO?    One enhancement to the Scan Engine is to add raw to engineering scaling and a polynomial function for the analog I/O in the Tag Configuration Engine for obvious reasons.

 

 

Thanks,

Steve

Member
Daniel_E
Posts: 123
0 Kudos

Re: Simple Machine Control Reference Application

The Scan Engine should return IO Variable data in the form you defined in your project.  For example, sometimes I use the 9211 thermocouple module.  I can set up the IO Variables to be different types of thermocouples and to have units of Kelvin, Celsius, etc.  The data returned to me from the Scan Engine reflects these settings.

 

I was using temporary tags to scale data because I was reading my own simulated (non-IO) data from the FPGA.  You aren't doing this (most people won't) and therefore you shouldn't need extra tags.

Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control
Member
Steve Sexton
Posts: 11
0 Kudos

Re: Simple Machine Control Reference Application

I can't seem to get the TCE to open the MCA_Localization.xml file.  I have attached an image of the error.

 

 

I there a Simple Machine Control Example sans the localization code?  The localization adds a vast amount of complexity.  You could call it "A Simpler Machine Control Example".

Member
Daniel_E
Posts: 123
0 Kudos

Re: Simple Machine Control Reference Application

[ Edited ]

Hey Steve,

 

That is a good point about the localization adding complexity.  If you decide to remove that from the code, please post the result to this thread as I think it would be helpful for other users. 

 

To address your error, this is expected because the TCE only edits tag configuration files.  We have a localization editor (http://zone.ni.com/devzone/cda/epd/p/id/6257) that edits localization files. 

 

I hope this helps!

Message Edited by Daniel E on 12-28-2009 11:16 AM
Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control
Member
Steve Sexton
Posts: 11
0 Kudos

Re: Analog Values

I need to stabilize the analog reading that.  How would I implement a routine that is synced with the scan engine and averages three to five analog reading?

 

How do I go about scaling analog values?  I'm using a NI9203 AI module (+-20mA input) and get a reading of zero with 0 mA and a 0.1 when +20mA are applied.  My sensor puts out 4-20mA for 0 to 1000 psi.

I've tried to use the scaling in the properties (right-clicking on the channel and selecting scaling) but it doesn't seem to work the way I imagined. 

 

 

 

 

Member
Daniel_E
Posts: 123
0 Kudos

Re: Analog Values

Hey Steve,

 

I would put your averaging algorithm directly after the CIE Scan VI.  So the CIE Loop code should be Synchronize to Scan Engine VI -->  CIE Scan VI --> Averaging Algorithm.  I would create new tags for the resulting averaged data.

 

As for scaling, you should be able to change the scaling in the IO Variable node in the project, deploy the changes, and have everything in terms of the scaling applied.  If you forget to deploy, the changes won't occur.  I think your end configuration should look something like this:

 

Scaling.png

 

I hope this helps!

Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control
Member
Steve Sexton
Posts: 11
0 Kudos

Re: Analog Values Scaling

I was doing a couple things wrong.

 

I set the Raw values set to 4.0 and 20.0.  When I should have set them to 0.004 and 0.020.

 

I was clicking on the chassis icon and doing a plain "Deploy" which does not push the scaling to the crio.

I had to right-clicking on the top level target device icon in the project and selected "Deploy All".    

 

 

There's always a learning curve...

 

Thanks

Member
wireman
Posts: 44
0 Kudos

Re: Simple Machine Control Reference Application on Window CE

This is a wonderful reference app, implementing most of the things that we want to do (at least for our current project). However, it should be noted that currently the Reference Architecture is not runnable in Windows CE (e.g. TPC-2012) because CE does not support many of the property nodes and variety of other things. We have modified it to work, but perhaps NI could modify it with Conditional Disable Structures to work out of the box on CE?

 

Also, to anyone who wants to make nice graphical HMIs on their touch panels, I would seriously advise that you step up to an Windows XPe (embedded) system like the TPC-2512. It will save you significant headache trying to get around the many graphical limitations of a Windows CE  machine.

 

-Nate

Member
Daniel_E
Posts: 123
0 Kudos

Re: Simple Machine Control Reference Application on Window CE

Thanks for the feedback Nate!  We love hearing from people who are using our open source tools.

 

I agree about using Windows XPe touchpanels.  Windows CE can work well for very simple UIs but anything of size should be on XPe.

 

Thanks again!

Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control