Solved

Digital output

Posted on 1998-10-23
8
157 Views
Last Modified: 2010-04-26
I'm programming for an application that writes 2.5 millions
of 9 bit signals on a port (like parallel). The process takes to me about 4.5 seconds and it's too much. I have an ISA card called DAS-1202 (Keithley-Metrabyte).
I would like to make it faster (1 second).
To write on the ports I use c++ _outp.
Solutions?
0
Comment
Question by:css
8 Comments
 
LVL 15

Expert Comment

by:jrhelgeson
ID: 1127516
Ok, so what's the question?
0
 
LVL 32

Expert Comment

by:jhance
ID: 1127517
There are four factors here affecting the speed of your output to the port:

1) Speed of your CPU (i.e. instructions/second) let's call it MIPS
2) Overhead in your loop (i.e. instructions/loop), say INST
3) Times through the loop (i.e. 2,500,000), call it N
4) Port handshaking time, if any (i.e. seconds of delay), call it T

So you can calculate the total time as:

T = N * [T + (INST/MIPS)]

From the information above, you've told us only about N.  What else is going on in your loop that is slowing things down?
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1127518
You want speed? Use .ASM. Open a file with the data points, load up the buffer and *GO*.

Your going to run into problems in *any* language in that the first time an interrupt fires your task is going to suspend while the interrupt is serviced. This will give a "dead spot" in your signal. The more the rest of the system is doing, the more dead spots you'll see. This will also occur if your output loop has to hit disk. Ditto for doing any OS calls.

If you want predictable high speed operation you'll need to shut down windows and run on a single threaded DOS box. This will allow you to block interrupts and honk your data stream in one long thread. You'll tie up 5Mb of RAM just to hold your data (9 bits, you'll have to use 16bit words to hold the data.) Basic output loop is trivial, but you'll need to preload RAM with the data so you don't have to hit disk while you're running.

M
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:css
ID: 1127519
I want to know what's the best hardware for digital output ... tell me a product like DAS-1202 (Keithley Metrabyte). I want 16 bit output otherwise I used the parallel.

0
 
LVL 12

Expert Comment

by:public
ID: 1127520
Why dont you get a PCI parallel port card? You can also use an extra ide channel as a 16 bit parallel port.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1127521
I've always had good luck using 8255 based devices. They're very flexible and with 24 I/O lines you can pretty well configure what you need. What to use for output depends on what you're driving.

M

0
 

Author Comment

by:css
ID: 1127522
What's 8255 based devices? Have you got a product name and an internet address where I can read for information?

Thank
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 200 total points
ID: 1127523
Keithly-Metrabyte sells them. The main I/O chip is an Intel 8255 multipurpose I/O. It has three banks of eight lines that can be set as inputs or outputs in groups of four. Thus you can have 24/20/16/12/8/4/0 lines as either inputs or outputs. The outputs are latched and have readback capability so you don't have to keep the state of the device in memory, you can just read it to recall what it was. There are also certain other output modes that it supports for strobed I/O with handshake, etc. Works well and is fairly easy to program. It defaults to all input when first powered up so you can initialize it cleanly.

M

0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Graphics card for a new Dell 5810 workstation 16 147
SBS 2011 Backup Drive 8 72
canon pixma mg2922 printer scan 10 45
DVD BURNER 2 35
Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
This video teaches viewers how to process images for a time-lapse video. Programs required: Adobe Lightroom, Adobe After Effects, Video Editing Program. In Adobe Lightroom: Import sequence image files into Adobe Lightroom: Develop settings of an I…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question