Programming :: Create A RS232 C Program That Executes A Series Of Commands Down The Line To A Robot?
Jan 5, 2011
I am trying to create a RS232 C program that executes a series of commands down the line to a robot. Everything seems to work fine, except any sequential write to the serial port. At first I thought it was the UART's buffer being filled too fast, but even with a 50 uS delay it still throws the error.
Here is my code:
Code:
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/signal.h>
#include <sys/types.h>
[Code]...
View 1 Replies
ADVERTISEMENT
Mar 23, 2010
I would like to make a script, where I specify my Cisco devices IP addresses as arguments to the script and then this script automatically logs into every one of them and does "show version" and "exit" in every Cisco device. I have public/private key authentication system with my Cisco devices- thats why I'm using ssh-agent and ssh-add. I did something like this:
Code:
#!/bin/bash
if [ -z $1 ]; then
echo USAGE:
echo "$0 IP1 IP2 IP3 IPn"
[code].......
However, it logs nicely into the first device(I'm able to execute IOS commands in this first Cisco device etc) and then does nothing further.
View 1 Replies
View Related
Dec 16, 2009
I've started development on a ARM board. The ARM board displays it's command prompt through it's rs232 output. So I open putty/minicom (rs232 display) and can see and interact with the ARM linux system through my PC. The ARM root fs is on a USB pen, So I cross compile on my PC, then plug the pen into my PC copy the exe into the home/usr etc folder. Then unplug. plug it into the ARM boot the ARM and from my PC rs232 window can run the code. However plugging/unplugging is taking an age, I'm sure there must be a way to transfer the exe across the rs232. I've tried to use putty minicom to do so throught various methods xmodem etc but don't seem to be able to. I think I must have to do something on the ARM end but am unsure what?
View 7 Replies
View Related
Apr 6, 2011
basically i have to create a simple program with will continually read input from the user until they enter a blank linei know how to read in certain input but not sure how to get it continually in a loop
View 2 Replies
View Related
Aug 22, 2011
I'm developing in java.
I want to create a GUI interface for some command line commands (drush - drupal).
How can I interact with the command line commands with java? or any other languege?
View 6 Replies
View Related
Jul 14, 2011
I want to use a desktop icon shortcut that essentially does this...
Is there a way I can do this? I don't really want to create an alias because I just want it to be an icon I double click to do all of this. But if I have to create an alias in which it does these ocmmands then I use the shortcut to terminal... then it types the alias that is fine also.
View 1 Replies
View Related
Feb 11, 2010
Is it possible to create a symbolic link that include commands for the program?
For instance, I do the following to start the program:
./script -somecommannd
I would like to create a symbolic like that includes "-somecommand"
Is this possible? or would I need to create a second script that executes that command, and link to that script?
View 4 Replies
View Related
Jan 5, 2011
I am trying to write a script that connects to a server and executes some commands on there. Something like this:
#!/bin/sh
telnet remote_machine
cd /home/some_directory
cat a_file_in_current_directory
Unfortunately after login/password I guess the script doesn't jump past the telnet command, until I exit. What do I need to do to make the script start executing commands in the remote shell?
View 1 Replies
View Related
Jan 28, 2011
I have a computer with a trackpad and a touchscreen. I want to run unclutter if I use the touchscreen, and kill it when I use the trackpad or a USB mouse.
The I'm pretty sure the touchscreen is /dev/input/mouse0, and the trackpad is /dev/input/mouse1
I have a general idea of how this should work, but no idea what tools and commands to use to implement it.
View 1 Replies
View Related
Apr 11, 2010
I have a project due for my Intro to C++ class and we are suppose to generate a file listing that will take an input of a C++ source code with .cpp extension and make a copy of it with a .lst extention that will have a line number preceding each and every line.
View 12 Replies
View Related
Apr 3, 2011
In below program I want to add (as part of the valid_cmds string) the pwd (print working directory), lo (logout), and cd (change directory) commands. However when I add those into original program ;
char *valid_cmds = " ls ps df pwd lo cd";
they are not working I have the cout message huh?
Original source code is below code...
View 3 Replies
View Related
Jun 20, 2011
Player-Stage uses .cc files. I know how to compile them. But how do I actually execute my code? There is an output file generated. There is nothing in the .cfg file or in the .world file that specifies what program to use to run the robot. Or is it not specified in the world or cfg files?
Then how to make the robot obey my compiled .cc file? If this question is silly or if I am asking stupid questions
View 5 Replies
View Related
Feb 21, 2010
I use a few command line programs quite often such as nano and mpc. I'd like to create a shortcut icon to open them rather than opening a terminal and then typing in the program name to open it. For example, how could i open konsole with nano opened in one step?
View 5 Replies
View Related
Nov 12, 2010
even though this is a simple task I always have problems to do this.I want to execute the following#!/bin/bashjava -jar JabRef-2.6.jaror in other words this is the command I use in konsole to make the application to launch.Then usully I try to create a desktop in the icon either by using a. create link to locationorb. create link to application.where I select as file the file myfile.sh that contains the two lines of code I posted above (see again below)
"#!/bin/bashjava -jar JabRef-2.6.jar"I do this file executable by using the chmod +x.Sometimes I think this works while others like now I only receive the cursor bouncing for sometime before it dissapears
View 4 Replies
View Related
Dec 6, 2010
I am trying to create a script that creates a vector and displays it. I used the command inivec but it didn't work.
[code]...
How do I make it so the terminal executes mi script to create a vector. I know MV is the name and the output should be aa aa aa, but nothing?
View 3 Replies
View Related
Aug 27, 2010
Iv got an assignment to complete and I'm stuck at the basic level.
A part of the assigned problem is :
The main process will read the file, and will create N number of child processes (Where N is taken as input) as early as possible before all the children starts its execution. Before creation of each child, the main process should read the file to store all the required data in then corresponding data structure. Child processes should not read the file for getting their information.
As far as my knowledge about this , the child executes before the parent. How do I make the parent not pass the control to it's children before it finishes creating all the children?
View 3 Replies
View Related
Jun 1, 2010
I have been working on writing a small rs232 driver like minicom for months. I am almost there, I have the interrupt service routine running, I can read() ok. However when I write(), it returns the number of characters written, 1, but nothing is actually written out the port. I researched termios, and they say that serial port programming is really messy in linux/unix.
I am probably not setting up the port parameters correctly, or my write() function is not doing what it is supposed to. As I said, write() is returning successful. Other comm programs run ok (picocom & gtkterm) on my hardware. I am running knoppix/debian on an ancient computer. I saw other guys using slackware.
View 14 Replies
View Related
May 10, 2011
Executing series of grep commands to get counts in a large file. I'm appending to this file. Series of commands will be;
"greg -ir "May/0504" SentEmails.txt | wc -l >> Stats.txt
"greg -ir "May/0505" SentEmails.txt | wc -l >> Stats.txt
"greg -ir "May/0506" SentEmails.txt | wc -l >> Stats.txt
"greg -ir "May/0507" SentEmails.txt | wc -l >> Stats.txt
View 3 Replies
View Related
Apr 1, 2009
I'm trying to attach an fstream to serial port for reading and writing with the following code:
Code:
#include <iostream>
#include <fstream>
#include <string>
[code]....
The code compiles without errors, but doesn't catch any input text from the device attached to RS232. I have tried it with Rx and Tx connected, but didn't receive my text back. It works OK if I substitute /dev/ttyS0 with an ordinary file, but any attempt to use /dev/ttyS0 seems to lead to an empty answer string. I tried this on a PC under Ubuntu Linux 7.10.
View 3 Replies
View Related
May 14, 2011
I used Ubuntu for three years and was recently trying Debian and am now giving Fedora a try. When I switched to Linux I was almost computer illiterate. Even now I only know a little about using the terminal. So forgive me for asking such a simple question.I want to install some extra founts that I need, but Fedora is a little different than the systems I am familiar with. I quickly looked through posts in this forum and noticed solutions using long series of terminal commands. With Debian and Ubuntu I added founts by using a nautilus command to get by the permissions (specifically, gksu nautilus). Does Fedora have a similar tool, or must I use the terminal? I want to install quite few founts and do not want to spend a whole day doing it. If terminal is the best solution, I need a little clarification. I saw people using su in their command lines. Does that refer to sudo?
View 13 Replies
View Related
Apr 4, 2011
I'm writing a bash script that executes a few perl scripts. One of the perl scripts that I need to execute requires two arguments with it. The arguments are stored in a txt file, each line contains a hostname and its corresponding IP address separated by a ":" (colon), the txt file looks like this below:
[Code]...
I'm not sure if it's the best way to accomplish this but here it goes. In the bash file, let's call it getHosts.sh, I create an array and assign each line of the file to an element in that array. I then think I need to create a new array where I take the hostname (which is before the ":") separate it from its IP address and place the IP address on a new line just below the hostname (this way I can reference to it like $hostNames[$x] would be the hostname, and $hostNames[$x+1] would be its IP address). So the new array would now look like this below:
[Code]...
View 4 Replies
View Related
Nov 29, 2010
I am writing a program to send data over serial port but the sending and reading operation is not occurring as desired to be... Below you can see the read and write parts. Could you please help me to find where I am doing wrong...
Reading Part:
Code:
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
[code]....
When I compile and run the above programs Reading part does not read the 13 bytes once it first reads 8 byte then 8 again then 2 and so on. It always divides the sent data...
View 8 Replies
View Related
Apr 20, 2011
I am very new to Linux and trying to learn the shell scripting. Just to know is there any client in linux which does the same task as FTPS on windows. FTPS on windows can read series of FTP command from a txt file and execute them. Is there any way to do that same task, i mean reading series of ftp commands from a txt file, on linux suing shell or perl (any module)?
View 2 Replies
View Related
Feb 7, 2010
I am wanting to write a program that runs a program or command-line. Is there are way of making a program that activates a command-line (for example executing 'ps -a -f' or '/home/shared/fah').
In addition to that, I want the program to do a 'ps -a -f' and put the results in a buff, how could I do this.
View 5 Replies
View Related
Aug 5, 2010
I want to send something through the serial port, for example
[code]...
the point here is send some numbers to a couple of 7 seg displays, so I will wire a RS232 chip on a protoboard, the logic after the RS232 is not an issue, but how can I assure the data is being sent right from my linux box to the RS232 chip, the one on the protoboard? Do I have to write a C program to read the strings and then send them to the serial port?For example if I wanted to send this to the displays:
[code]...
So I guess the simplest way is (Supposing I can deal with the stream so it is filtered and only display the number array) $ ifstat > /dev/ttyS0 But, how do I know if the RS232 will take them as the right characters?
View 3 Replies
View Related
Mar 28, 2011
I`ve just installed opensuse 11.4 and i dont know how to write and compile my programs
is there a compiler like turbo c++ to use??
View 5 Replies
View Related
Oct 11, 2010
I thought about this a while ago when reading through a Python tutorial and I googled some and couldn't find an answer. Now I want to know it for Ruby, also, and it's more important now because I want to invoke Ruby with -w.
How can you use:
Code:
with a -w option to ruby, like:
Code:
This doesn't work and I can't find an explanation of how to do it.
Code:
View 1 Replies
View Related
Aug 6, 2010
Since 2005 when DualCore CPUs came out, you need to create unique multithread algorithms for every particular program? Or you have patterns?
View 4 Replies
View Related
Sep 25, 2010
I have a file with two fields of numbers that I want to use as input for another program.
Code:
The above code does not work, as I think it would take the whole first and second fields as the input for one particular instance of the program 'inputbashangle'. What I want is to get the first two numbers from the first line of the file 'outfailtest', execute 'inputbashangle' with them, then move on to the first two numbers of the second line for all the lines of 'outfailtest'.
View 9 Replies
View Related
Dec 28, 2010
If i have a python file with a function call_me(a,b),how can I call this function from the command line ,after i compile the program?
View 5 Replies
View Related