Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 10:47:54 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
General Mach Discussion
Coordinates reading from RS232
Pages:
1
Go Down
« previous
next »
Author
Topic: Coordinates reading from RS232 (Read 227 times)
0 Members and 2 Guests are viewing this topic.
Bit79
Active Member
Offline
Posts: 7
Coordinates reading from RS232
«
on:
January 16, 2012, 11:20:13 AM »
Hello!
I have a cnc under mach3, equipped with optical lines and external DRO. The external DRO has RS232 port and it can send continuously the value of the 3 axis. I'd like to receive this values in mach3, when i push a button, so i can update mach3 DRO with value of external DRO.
For test I try to send data from mach3 to another PC with hyperterminal, and it work correctly using 'call sendsendserial'. I set RS232 proprieties in Config/Logic windows in mach3.
For receiving data i try to use this VB script:
data = "none"
q = 0
while data = "none"
q=q+1
if q=10 then
message "receive error"
exit sub
end if
settimer(1)
while gettimer(1)<0.5
wend
data=getfifoentry()
message data
wend
It must wait about 5 second testing the serial port, then if it doesn't receive data, show error message. I try to send some data to mach3 after script start, but it can't receive anything and after 5 second it show the error message. I think there are some bug in my script but i can't find them... could you help me?
Thank you!
Logged
Bit79
Active Member
Offline
Posts: 7
Re: Coordinates reading from RS232
«
Reply #1 on:
January 19, 2012, 09:05:33 AM »
Where can I find explanation for the instruction getfifoentry? I read all downloadable documentation, but I can't find it...
Thank you!
Logged
stirling
Global Moderator
Online
Posts: 1,190
UK
Re: Coordinates reading from RS232
«
Reply #2 on:
January 19, 2012, 11:43:03 AM »
Hi - there are two types of serial interface to Mach (not counting modbus). One is the "standard" serial interface which consists of the single call of sendSerial(string) which has no counterpart for reading. The other is the so called "event driven serial" interface which consists of sendFIFO(string) and string = getfifoentry()
These need to be set up on the ports n pins dialog and via the menu function cfg's/serial monitor. Other than this AFAIK there is no documentation. I've used them successfully though so they do work.
One thread that may help is Reply #61 onwards in
http://www.machsupport.com/forum/index.php/topic,18759.msg131496.html#msg131496
Hope this helps.
Ian
Logged
Bit79
Active Member
Offline
Posts: 7
Re: Coordinates reading from RS232
«
Reply #3 on:
January 26, 2012, 02:16:20 PM »
I solved the problem. I see it need CR caracter at the end of the receive string. Luckily the external DRO i will use include this caracter in the trasmission.
Thank you!
Logged
Bit79
Active Member
Offline
Posts: 7
Re: Coordinates reading from RS232
«
Reply #4 on:
January 26, 2012, 03:26:07 PM »
Now I have another problem.
I test VB script in VB editor of mach3 and it works correctly, but when i put in a pushbutton of a screen it doesn't work. I tryed a lot of different codes. Under VB editor they work, under pushbutton it fails when they receive CR caracter.
This is an example of simple code:
data=getfifoentry()
If data = "None" Then
message "receive error"
Else
message "receive ok"
End If
Under VB editor, if before launch program i send a CR caracter into serial port it shows "receive ok" message, else it show "receive error". This is ok.
But under pushbutton, without receive it shows "receive error" message, but i send the CR caracter to serial port the script fails, and it doesn't show any message. Where is the problem?
Thank you!
Logged
Bit79
Active Member
Offline
Posts: 7
Re: Coordinates reading from RS232
«
Reply #5 on:
February 01, 2012, 03:31:02 AM »
I tried to put the script in a macro, but I have the same problem.... without receive it shows "receive error" message correctly, but if I send CR, the script crashes...
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...