Posts

Showing posts from September, 2009

Siemens PCS7 Direct PLC Tag Data Retreival

Image
Exciting Work in Development at IDX TOPIC: PCS7 Direct PLC Communication via IDX Runtime Background: IDXOnline has an exciting solution in development to solve a long–standing challenge which involves collecting plant data directly from the Siemens PLC as opposed to from the WinCC OPC Server. Out with the old: In With the New: How will we achieve this? IDX has obtained a dll package from one of our partners that are able to communicate with a Siemens PLC via TCP/IP. The package is suitable to be incorporated into the IDX runtime as a driver module, and thus will work like any other IDX driver module will enable communication with any other software that IDX currently supports. Is there already software available that can do this? Yes. IDX has tested the Softing S5/S7 OPC Server as well as the Wonderware DasSIDirect Server, and the results that this test yielded were impressive when compared to the standard WinCC OPC server. A report of the findings i

C# COM issue : "the application has called an interface that was marshalled for a different thread”

Hello people. I bled a little on something, so I thought I might share and save you some pain: When calling code in a com class (for example, when using an external dll written in some other language (vb, for example), the implicit threading can be an issue) VB by default uses STA threading (Single thread apartment), which loosely means that the application runs in one thread. If you use the above class in C#, which by default uses MTA (Multi thread Apartment), You get an error : “the application has called an interface that was marshalled for a different thread” . SO: When you use such a dll in c#, you need to add the [STAThread] directive above your main program.cs file as follows: namespace MYIDXApp {   class TimeServer   {     [STAThread]     static void Main(string[] args)     {     }   } } Furthermore: There is a “feature” in c# that even though you specify that the main thread runs under STAThread, any timer events happen as MTAThread. Thus, for a timer event, you must