Home
Narrow screen resolution Wide screen resolution default color green color orange color
FDCS Card 1000 Data Control System - Software Programming base Print E-mail
Written by Administrator   
Monday, 18 February 2008

ImageCiftronik manufactures  low-cost, high quality, serial data acquisition and control interfaces that allow  data acquisition and computer control via a serial port (RS232 or USB ). {mosgoogle}

 When connected to a serial port the FDCS boards allow control of analog (A/D and D/A), digital I/O, relay contacts and event counters using simple ASCII commands.  Easy to interface to LED's, switches, potentiometers, analog sensors or stepper motors. Programming is easy using VB.NET, Visual Basic, Basic, LINUX, C, Visual C++ or any language that allows access to a serial port.  {mosgoogle}

Serial Data Acquisition Made Easy
adr01.jpg (28848 bytes)

 

 

Example Visual Basic Program

 

Private Sub Start_Click()

Rem Ensure Relay K0 is off.

MSComm1.Output = "RK0" + Chr (13)

Rem Enable interrupts.

MSComm1.Output = "IE" + Chr (13)

Rem Wait for interrupt from switch.

Do

Dummy = DoEvents()

Loop Until MSComm.InBufferCount >= 3

Rem Display interrupt in text window. ( Empties input buffer )

Text1.Text = MSComm1.input

Rem Clear event counter

MSComm1.Output = "CE" + Chr (13)

Rem Load trigger register with 160 ( also enables counter interrupt )

MSComm1.Output = "TL160" + Chr (13)

Rem Wait for interrupt from event counter.

Do

Dummy = DoEvents()

Loop Until MSComm.InBufferCount >= 3

Rem Display interrupt in text window. ( Empties input buffer )

Text1.Text = MSComm1.input

Rem Energize relay K0 ( Turns on RED lamp.)

MSComm1.Output = "SK0" + Chr (13)

End Sub

 

 

Example Visual C++ Program

 

oversrvr.jpg (13,817 bytes)

 

 

CONFIGURING THE SERIAL PORT

The first step in accessing the serial port is setting up a file handle.

// variables used with the com port
BOOL     m_bPortReady;
HANDLE   m_hCom;
CString  m_sComPort;
DCB      m_dcb;
COMMTIMEOUTS m_CommTimeouts;
BOOL     bWriteRC;
BOOL     bReadRC;
DWORD iBytesWritten;
DWORD iBytesRead;
char       sBuffer[128];
 
m_sComPort = "Com1";
m_hCom = CreateFile(m_sComPort, 
    GENERIC_READ | GENERIC_WRITE,
    0, // exclusive access
    NULL, // no security
    OPEN_EXISTING,
    0, // no overlapped I/O
    NULL); // null template  

Check the returned handle for INVALID_HANDLE_VALUE and then set the buffer sizes.

m_bPortReady = SetupComm(m_hCom, 128, 128); // set buffer sizes 

Port settings are specified in a Data Communication Block (DCB). The easiest way to initialize a DCB is to call GetCommState to fill in its default values, override the values that you want to change and then call SetCommState to set the values.

m_bPortReady = GetCommState(m_hCom, &m_dcb);
m_dcb.BaudRate = 9600;
m_dcb.ByteSize = 8;
m_dcb.Parity = NOPARITY;
m_dcb.StopBits = ONESTOPBIT;
m_dcb.fAbortOnError = TRUE;
 
m_bPortReady = SetCommState(m_hCom, &m_dcb);

Communication timeouts are optional but can be set similarly to DCB values:

m_bPortReady = GetCommTimeouts (m_hCom, &m_CommTimeouts);
 
m_CommTimeouts.ReadIntervalTimeout = 50;
m_CommTimeouts.ReadTotalTimeoutConstant = 50;
m_CommTimeouts.ReadTotalTimeoutMultiplier = 10;
m_CommTimeouts.WriteTotalTimeoutConstant = 50;
m_CommTimeouts.WriteTotalTimeoutMultiplier = 10;
 
m_bPortReady = SetCommTimeouts (m_hCom, &m_CommTimeouts);

If all of these API's were successful then the port is ready for use.

SENDING COMMANDS TO THE FDCS1000

To send commands to the FDCS1000 the WriteFile call is used. For example, the following call sends an RE ( read event counter ) command to the FDCS1000;

bWriteRC = WriteFile(m_hCom, "RE\r",3,&iBytesWritten,NULL);

The \r escape embeds a carriage return character at the end of the transmitted string. The FDCS1000 uses this to recognize a command.

RECEIVING DATA FROM THE FDCS1000

If a command sent to the FDCS1000 is a responsive command, that is, one that results in data being sent back to the host, the data is retrieved using the ReadFile call.

bReadRC = ReadFile(m_hCom, &sBuffer, 6, &iBytesRead, NULL);

When you are through using the file handle simply close the file.

CloseHandle(m_hCom);

I hope that this assists you in your programming efforts.

If you want to FDCS-1000 board, you can order and contact me at : This e-mail address is being protected from spam bots, you need JavaScript enabled to view it

Comments
Add New Search RSS
gfefr   |2010-03-03 02:49:14
wow...High Heels,women's good friends,we can not live without,as it can make us look more
tall and charming.Now Christian shoes is more and more popular.I believe you must have ever heard of Christian shoes,right?
garg   |2010-03-27 03:06:04
Christian Louboutin shoes are very popular among fashionable ladies and young girls, frot its
character of elegance and noblity. So do the Herge Leger Dresses. This is why many girls like wearing the shoes going with the
dress. Many young ladies are accustomed to dress themselves sitting in
front of the mirror and decide whether they should wear Links of London or American stylish Tiffany Jewelry. When they fournd it is snowing outside and they will surely want to
protect their feet to wear UGG Boots and select MBT Shoes for their husbands who are watching some attractive films from Wholesale DVD shelf. Referring to the gender difference, brave gentlemen will take the

Vibram Five Fingers Shoes with them and explore a chance for adventure. Life is so colorful
with all sorts of products we can offter, do you agree with me?

 
Christian Louboutin Sale Christian Louboutin Sale Christ...
DVD Box Sets     |2010-04-10 06:19:13
762483369175567324 Yesterday he DVD Box Sets issued a new DVD Box Sets patch for Mortal DVD Box Set Online, which is that Best DVD Box Sets as we told you last week, the game Discount DVD Box Sets was delayed for 1 DVD Sets month at the request DVD Boxed Sets of the beta testers. Now developers DVD Boxed Set are putting Boxed Sets the missing content and correcting errors Boxed Set and bugs that are being reported. This Boxed Set Dvds patch is one of the most interesting, in the Dvd Gift Set words of one's Beta Dvd Gift Sets Testers and that other DVD BoxSet improvements include DVD BoxSets the Crafting system, major DVD TV Series changes in the DVD Box Sets For Sale optimization of the DVD Box Sets On Sale game and added areas and DVD Box Set interface improvements.
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."


Share & Save
Last Updated ( Saturday, 08 August 2009 )
 

My Information

Investasi emas dengan harga 1/3 harga emas...mau tahu caranya??? Daftar
di sini!
FORMULA BISNIS ala Joko Susilo...Terbukti! Buktikan sendiri
di sini!

My Business

Adsense Indonesia

Join Vinefire!

My Language

My Tools

Yahoo bot last visit powered by MyPagerank.Net

Msn bot last visit powered by MyPagerank.Net

My Chat

My ShoutBox

Free chat widget @ ShoutMix Locations of visitors to this page

My Syndicate

Who's Online

We have 17 guests online

Visitors



Countries

31.6%China China
25%Indonesia Indonesia
12.7%United States United States
6.6%Australia Australia
3.7%India India

Visitors

Yesterday: 3
This Week: 18
Last Week: 47
This Month: 10
Last Month: 201
Total: 1670


JoomlaWatch Stats 1.2.9 by Matej Koval

User