Snap7 + Ni Labwindows/CVI - dllimport

Hi guys i am working on a project where my client wants to use Siemens S7 1200 to control some pneumatic tools and an interface on labwindows Cvi.
I downloaded SP7 ( snap 7) on a try to communicate with my plc but i found myself blocked since the downloaded file contains only a DLL file and a lib file whit no.h file ( header file )
could anyone tell me how to use snap 7 properly on labwindows ?
thanks

AFAIK if you want to use Snap7, you'll have to download the source (C++) and then manipulate it to work with LabWindows.
S7-1200s also have the following communication options.
Free-of-charge:
Modbus/TCP
Socket services ("Open user communication")
MQTT unencrypted
For a fee:
OPC UA
More here:
Communication methods for S7-1200/1500 PLCs
Personal opinion: if you don't have many data points to monitor, I would go with Modbus/TCP.

Related

Handheld Scanner with nodejs and OPOS

I was struggling with this for a couple of days now and Google seem to have no information..
I'm trying to interface a DataLogic-QuickScan-QD2131 scanner using OPOS (under windows 10, RS-232 OPOS interface) with nodejs.
I understood that OPOS uses ActiveX controller to communicate, so i use the winax npm-package to create ActiveXObject reference, but I have no idea what is the "class string" i should provide to the constructor.
Here's my code:
require("winax");
const con = new ActiveXObject("OPOSService.OPOSScanner");
console.log(con);
this will fail with the following error:
Uncaught Error: CreateInstance: OPOSService.OPOSScanner Invalid class string
Thanks guys!
You probably should stop using OPOS from Node.js.
As I answered your other question, the current OPOS only supports 32bit.
If you still want to use it, find and specify the programmatic ID string for the scanner OCX in DataLogic's OPOS.
I don't have any information about what it looks like, so you can find it yourself or contact DataLogic.
As an alternative, obtain and install the Common CO from the following page and specify "OPOS.Scanner" as the programmatic ID.
MCS: OPOS Common Control Objects - Current Version
If you have a combination of Node.js and a barcode scanner in serial port mode, it would be better to send commands and receive barcode data directly from Node.js using the serial port instead of OPOS.

Connect Wifi in MS Universal windows app?

We know an iOS app can connect to Wifi with CaptiveNetwork reference. As described in some related post: Connect WiFi Network via App.
Is there any similar library to help a Windows app to view exising wifi around and get connected?
Yes. There's the Windows.Devices.Wifi namespace. (Details here https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.wifi.aspx?f=255&MSPPError=-2147217396 )
It offers Methods to list networks and a method called ConnectAsync() to connect. I once coded a sample here (it also covers other stuff): https://github.com/DanielMeixner/w10demoking/blob/master/Windows10DemoKing/wifi.xaml.cs
The magic lines of code are
using Windows.Devices.WiFi;
// create network adatper instance (see sample code in link above) ...
var nw = nwAdapter.NetworkReport.AvailableNetworks.Where(y => y.Ssid.ToLower() == "myssid").FirstOrDefault();
await nwAdapter.ConnectAsync(nw, WiFiReconnectionKind.Automatic);

Using ActiveX Com Components with nodejs. Is it possible

Is there a way to use any ActiveX com components with nodejs?
Actually, I would never need this but I'm running nodejs on Windows and trying to send ping requests without forking new processes (no such module exists for Windows).
As some Activex components exist for sending ping requests with raw sockets, maybe I can use them.
An example of how you can create a COM object from JavaScript is:
var rs = new ActiveXObject("ADODB.Recordset");
There is node-win32ole ( npm install win32ole ).
EDIT: win32ole is no longer actively maintained. You could try winax instead.
(updated)
You could try to use node-ffi to bind to Win32 and launch a COM/ActiveX component (CoCreateInstance) or access winsock/icmp directly. See https://github.com/rbranson/node-ffi
Or try to ping via WMI, e.g. "select * from win32_pingstatus where Address='...'". See https://npmjs.org/package/wmi
An ICMP ping module for Node.js now exists:
https://npmjs.org/package/net-ping
Years later:
node winax
node win32ole no longer works with up to date node.js versions

Actionscript 3.0 Disable navigateToURL

A web game I play on that allows user uploaded content has been having a lot of issues with people using the navigateToURL function to send players to random websites. I was curious if there was a way to disable this function using Actionscript 2 or 3. I have seen a way to do it using the HTML embed but I do not have administrative access to the website.
After doing some more research, I have come up with a solid answer:
You should use a combination of PHP and an executable called swfdump on the server side to validate the user uploaded content.
swfdump is an exe file located in the bin folder of the Flex SDK. You can run it from PHP using exec.
It will read the bytecode of the swf and produce a report. From that you can easily locate which files contain navigateToURL() and reject the files.
I tested a file of my own using swfdump -abc -out myfilereport.swfx myfile.swf
and in that output I found this:
findpropstrict flash.net:navigateToURL
findpropstrict flash.net:URLRequest
pushstring "http://www.plasticsturgeon.com"
constructprop flash.net:URLRequest (1)
callproperty flash.net:navigateToURL (1)
The url I was using was "http://www.plasticsturgeon.com". But it would be far easuer to just eliminate any swf that includes flash.net.navigateToURL. Once you identify tha is present you can generate an error notice to your end user.
So using this method you can find and reject any swf that is using navigate to URL. You could even create a batch to run and invalidate any existing assert with this problem.
More information about using bytecode:
http://code.google.com/p/redtamarin/wiki/ABC
And about decompiling ASbytecode:
http://dougmccune.com/flex/FOTB_Decompiling_Doug_McCune.pdf

Accessing audio samples from linphone

I'm using linphonec (without gtk interface, only command line) in Linux and I want to access incoming and outgoing sound samples, but I don't know what file should I edit to access them.
Can anybody give me a clue, please?
Assuming the outgoing and incoming sound samples are related to a call
e.g. you are typing linphonec> call sip:usernumber#someproxy.net.
The call stack of the function is:
lpc_cmd_call from linphone-version/console/commands.c
linphone_core_invite_with_params from linphone-version/coreapi/linphonecore.c
linphone_core_invite_address_with_params from linphone-version/coreapi/linphonecore.c
linphone_core_start_invite from linphone-version/coreapi/linphonecore.c
linphone_call_init_media_streams from linphone-version/coreapi/linphonecall.c
audio_stream_new from from linphone-version/mediastreamer2/src/audiostream.c
Media stream is initialised on the host and can be accessed using mediastreamer2 API
In terms of accepting a call see the following call stack:
linphone_core_accept_call from linphone-version/coreapi/linphonecore.c
linphone_core_update_streams from linphone-version/coreapi/callbacks.c
linphone_call_start_media_streams from linphone-version/coreapi/linphonecall.c
linphone_call_start_audio_stream from linphone-version/coreapi/linphonecall.c
audio_stream_start_full from linphone-version/mediastreamer2/src/audiostream.c
Media stream is initialised on the client and can be accessed using mediastreamer2 API.
mediastreamer2 API documentation is avaliable here
linphone Source Code is avaliable here or
here

Resources