Summary :
Basic Sockets functions within Scilab					

Description :
This toolbox provide an interface between the Microsoft WinSocket library (v
1.0) and Scilab.
This toolbox runs only under Windows OS.
It can be use for instrumentation via TCPIP protocol (raw socket).					

Corresponding Author : Tibault Reveyrand
Website : http://membres.lycos.fr/treveyrand/products/SOCKET.html


Your comments

Reviewer : geisslea@web.de
Great Toolbox. It enables me to access my MGCplus Data Acquisition System (HBM,
Hottinger Baldwin Messtechnik Gmbh, http://www.hbm.com). I've written a small
sce-file for long-term Temperature acquisition:

W=[];
Told=-999;
SOCKET_init();
SOCKET_open(1,"172.21.109.20",7);   // Open's MGC with that IP adress
a=SOCKET_query(1,"IDN?",32)         // Identify System => Firmware Info
if ~isempty(a),
	a=SOCKET_query(1,"pcs1",50);    // Select 1st channel
	a=SOCKET_query(1,"sps1",20);    // Select 1st subchannel
	SOCKET_query(1,"UCC?",45)       // Get Channel name

	fd=mopen('c:\arbeiten\tempdat2.txt','w');  // Open's result text file

	realtimeinit(10);               // Every 10 seconds, a temp value is readed
	realtime(0);
	k=0;
	while k<180
		realtime(k);
		k=k+1;
		a=SOCKET_query(1,"rmv?",20);    // Read measurement value
		if ~isempty(a),                 // If answer is not empty, check temperature
value
			T=tokens(a,","); dt=getdate();
			Takt=eval(T(1));
			tempdiff=Takt-Told;
			if abs(tempdiff)>=1,        // If there is a significant change, write to
result file
				rhw=[dt,Takt];
				mfprintf(fd,'%5d\t %5d\t %5d\t %5d\t %5d\t %5d\t %5d\t %5d\t %5d\t %5d\t
%12.8f \n',rhw);
				Told=round(Takt);
			end		
		end
	end

	SOCKET_close(1);
	mclose(fd);
end
		

Current Rating : Number of Comments :1

Leave your comment

Your email address :
Your rate : Love it  Useful Just OK none
Comments :


Confirmation code :

Enter the code exactly as you see it.
The code isn't case sensitive.