[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
=?ascii?B?W1NQQU1dICBSZTogQ29icmEgb24v?= =?ascii?B?b2ZmIG1vbml0b3IgKGZ3ZCk=?=
- To: Peter Kammel <kammel@npl.uiuc.edu>
- Subject: =?ascii?B?W1NQQU1dICBSZTogQ29icmEgb24v?= =?ascii?B?b2ZmIG1vbml0b3IgKGZ3ZCk=?=
- From: Bernhard Lauss <lauss@berkeley.edu>
- Date: Sun, 18 Dec 2005 00:23:00 -0800 (PST)
- Importance: Low
SPAM: -------------------- Start SpamAssassin results ----------------------
SPAM: This mail is probably spam. The original message has been altered
SPAM: so you can recognise or block similar unwanted mail in future.
SPAM: See http://spamassassin.org/tag/ for more details.
SPAM:
SPAM: Content analysis details: (5.2 hits, 5 required)
SPAM: Hit! (5.0 points) Mail flagged as spam by physics Barracuda box.
SPAM: Hit! (0.2 points) BODY: Correct for MIME 'null block'
SPAM:
SPAM: -------------------- End of SpamAssassin results ---------------------
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
--------------080501070504000904050404
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Content-ID: <Pine.SOL.4.56.0512180022452.17553@socrates.Berkeley.EDU>
*******************************************************************
Bernhard Lauss E-Mail: lauss@socrates.berkeley.edu
Physics Department
366 LeConte Hall
University of California @ Berkeley
Berkeley, CA 94720 Tel: (510)-642 4057
United States Fax: (510)-642 9811
*******************************************************************
---------- Forwarded message ----------
Date: Sat, 17 Dec 2005 11:04:38 +0100
From: Stefan Ritt <stefan.ritt@psi.ch>
To: Bernhard Lauss <lauss@berkeley.edu>
Subject: Re: Cobra on/off monitor
Hallo Bernhard,
das Signal ist online verfuegbar ueber IP Multicasts. Du musst nur das
angehaengte Programm kompilieren und ausfuehren, es zeigt Dir jede
Sekunde den Strom im Haupt- und Hilfsmagnet an. Leider zeichnen wir
momentan diese Werte noch nicht permanent auf, das wird erst naechstes
Jahr kommen.
Gruss,
Stefan
Bernhard Lauss wrote:
> Hallo Stefan,
>
> Da wir momentan mit MuCAP Daten in PiE3
> nehmen, waeren wir an der Information
> wann der Cobra Magnet ein und aus ist / war
> interessiert und deine MEG collegen (Wataru und Andries)
> haben mich an dich verwiesen, da sie meinten du hasts ein
> solches Signal lschon am Web zugaenglich.
>
> 1) Wo ist ein solches Signal verfuegbar und fuer uns abrufbar.
>
> 2) Diese Daten sind fuer uns ab ~ Anfang November interessant.
> Sind diese Aufzeichnungen fuer uns erhaeltlich.
>
>
> Herzlichen Dank
> Bernhard
>
>
> *******************************************************************
> Bernhard Lauss E-Mail: lauss@socrates.berkeley.edu
> Physics Department
> 366 LeConte Hall
> University of California @ Berkeley
> Berkeley, CA 94720 Tel: (510)-642 4057
> United States Fax: (510)-642 9811
> *******************************************************************
>
--
Dr. Stefan Ritt Phone: +41 56 310 3728
Paul Scherrer Institute FAX: +41 56 310 2199
OLGA/021 mailto:stefan.ritt@psi.ch
CH-5232 Villigen PSI http://midas.psi.ch/~stefan
--------------080501070504000904050404
Content-Type: TEXT/PLAIN; name="cobra_current.c"
Content-ID: <Pine.SOL.4.56.0512180022453.17553@socrates.Berkeley.EDU>
Content-Description:
Content-Disposition: inline; filename="cobra_current.c"
/********************************************************************\
Name: cobra_current.c
Created by: Stefan Ritt
Contents: Receive broadcasts from COBRA magnet in PiE5 area
and display coil currents.
$Id: cobra_current.c 2842 2005-11-02 10:08:10Z ritt $
\********************************************************************/
#include <stdio.h>
#include <time.h>
#ifdef _MSC_VER
#include <windows.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#define DEF_MCAST_GROUP "239.208.0.1"
main()
{
int sock, n;
char cur_time[80], str[80], mcast_group[80];
struct sockaddr_in myaddr, addr;
struct ip_mreq req;
int size;
time_t now;
#if defined( _MSC_VER )
{
WSADATA WSAData;
/* Start windows sockets */
if (WSAStartup(MAKEWORD(1, 1), &WSAData) != 0)
return -1;
}
#endif
sock = socket(AF_INET, SOCK_DGRAM, 0);
n = 1;
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &n, sizeof(int)) < 0)
perror("setsockopt SO_REUSEADDR");
/* bind to port 1178 to receive cobra current broadcasts */
memset(&myaddr, 0, sizeof(myaddr));
myaddr.sin_family = AF_INET;
myaddr.sin_addr.s_addr = htonl(INADDR_ANY);
myaddr.sin_port = htons(1178);
if (bind(sock, (struct sockaddr *)&myaddr, sizeof(myaddr)))
perror("bind");
/* set multicast group */
printf("Multicast group: %s\b", DEF_MCAST_GROUP);
fgets(str, sizeof(str), stdin);
if (strchr(str, '\n'))
*strchr(str, '\n') = 0;
strcpy(mcast_group, DEF_MCAST_GROUP);
if (atoi(str) != 0)
strcpy(mcast_group+10, str);
memset(&req, 0, sizeof(req));
req.imr_multiaddr.s_addr = inet_addr(mcast_group);
req.imr_interface.s_addr = INADDR_ANY;
if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&req, sizeof(req)) < 0)
perror("setsockopt IP_ADD_MEMBERSHIP");
printf("Waiting for data from multicast group %s ...\n", mcast_group);
size = sizeof(addr);
do {
memset(str, 0, sizeof(str));
n = recvfrom(sock, str, sizeof(str), 0, (struct sockaddr *)&addr, &size);
/* get current time */
time(&now);
strcpy(cur_time, ctime(&now)+11);
cur_time[8] = 0;
/* print string */
printf("%s - %s", cur_time, str);
} while (1);
}
--------------080501070504000904050404--