Jump to content

zero-tolerance

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Everything posted by zero-tolerance

  1. Thanks for your help guy's, and sorry for posting this late, because I was out of town. I quite like the idea of I2DX and David's, solution too, since I don't really want to spend much money in it. Thanx again
  2. Hi, I know this might not me the right place to post this but I've used this forum before and I got great help from it. I just need to know if there are any programs or softwares to monitor the GPIB pins, i.e. for serial port or RS232 there is this program called PORTMON that monitor all trafic that happens in the RS232 of the computer, but is ther anything of similar sort for the GPIB. Thanks in advanced.
  3. Hi Warren, this question is out of curiosity. Untill now I have only been involved in sending and recieving bytes through pin 2 and 3 of the serial link. Does LV support the idea of controlling each individual pins on the serial port. I.e. I only use pin 2 & 3 to send and recieve, but what if I want to use pin 4 of the serial port to just send a single bit ( a binary 1 ). Im not sure how I could get a more of a HARDWARE controll over the serial port pins. any idea?
  4. Hi again Warren. I'm having a problem with the speed of the program that is executing. I think its because I am sending the "OC" command constantly and LV program is bussy all the time by trying to cope with this command. When I press the other buttons to check for the Status of the motor, or to reset it, or actually any other buttom then it takes quite some time before the commands are sent through and even longer for a reply from the PM341 device. I tried to send this command continuesly every 30 (ms), but I couldn't comme up with an idea how, since I havent dealt with timing issues before I am finding hard to do this. What I also need is for the messages of the PM341 when I recieve them to be displayed in 2 different sections. i.e. when I'm constantly monitoring for the position by the "OC" command I recieve a message like "01#23574" where "23574" is the position of the motor where I then Convert it to length, so that the user can see the "bar" sliding up and down, as well as numerically displayed. When I now press the "RESET button it resets the PM341 device and I recieve a message "01#OK", but I want this message to be displayed in a different place. there are all other different comands that I am using but they can all be displayed in one field appart from the position command which is the "01#23574". What I have done on the previous attachment NEARLY does the job but when I press the "CHECK STATUS" button I recieve a messages like "01#0000000000" to say that there are no errors and the motor is ready to be moved and this reply is always a 13 bit number but at the same time because all of the zeroes the place where I say "Motor X position" as well as the bar goes back to zero untill the "OC" command is sent and then I read another number. Is it possible for this to be done so that even though the "OC" command is constantly sent to the PM341 and during this time the user checks the motors status and then I recieve a message like "01#OK" and I want this message to be displayed to the user for at least 2 sec. even though I keep recieving the position of the motor continuesly. It would be nice for this 2 second rule to apply to all other messages that I recieve except the message that comes in the form of "01#23389 etc". I tried doing this by using different functions such as "Scan from String", as well as monitoring the length of the string so that if its bigger than 13 bits than I would display this message some place else, but I just couldn't get it fully working, which I guess I couldn't come up with a way of connecting these functions together. Thanks
  5. I have changed it to what you suggested, it greatly improved the look of it. Is it something of this sort that you had in mind. I took the 'OC' command off from the idea that I had by comparing the output to the input since I checked it with the supervisor and he said the same thing as you had. Never the less from this last program that you had posted i managed to learn the use and the importance of the LOCAL VARIABLES as I never knew what this was. but since you kept using it quite a bit then I studied it untill I understood what it did. I know it must be a very simple thing but it proved to be quite a powerfull function. P.S Your comments on the previous code were of great help. Specially the part where you sugested to use a sign inverter rather than what I had, you had labelled it as '***'. Sorry I never knew that such function existed, even though I've seen it many times. Many Thanks. Download File:post-4068-1142991591.zip
  6. I have experience with Microcontrollers and I had similar problems with it, specially the carrige return and line feeds. I programmed my microcontroller to have the carrige return and line feed but it beraly works in LabView, it must be somthing simple that I missed out as well, even though it worked fine in Hyperterminal. anyway, I have modified you program a little, this design worked for me, it might be the solution for you too. NOTICE: I have disabled the Carrige return, since that gave me a lot of problems, but with me it worked, even though theoratically to me it doesn't make sense. P.S You must get the Serial settings correct i.e. the baud rate, parity bit etc. just as WMassey mentioned. Download File:post-4068-1143025798.vi
  7. I really really apologise for making most if not all of my posts long. I just wanted to explain my needs as explicit and as detailed as possible. For this I actually meant FOR loop. These FOR loops are situated on the top right hand corner of the first image above. The bottom FOR loop is for motor X and the top FOR loop is for motor Y. You are correct about this but I was actually making this post while I was also doing the program, and when I took the screenshot at that time the "Decimal to String" as well as many other functions were not wired at that time. Sorry for creating this confusion. I tried doing it this way. The three images above show the way that I have connected them, but don't pay attention to the other functions that are outside the circled area as at that time I was trying different methods and some of the functions look unwired, but when I tested it everything was wired correctly. I only posted the way that I connected the FINAL result coming out of the serial and connecting that to the Shift Register and putting that through a FOR loop. I truly agree and from now on I will take your advice, but I would like to apologise in advanced for any parts of the wording that don't make sense, as English is my third language (even though that's not an excuse for me). As an addition to this post I am Uploading my up-to-date LV program that I made, but this one hasn't got the feature of sending the "OC" command whenever it's needed, but instead I just made it so that the "OC" command is continuesly sent to the motor (which really its not the preferred way at all). This program works fully except this last part. There might also be some unused VI's inside the SubVI's folder but I haven't cleaned it out yet as I am still modifying bits and bobs on it. Thanyou Download File:post-4068-1142737048.zip
  8. Sorry again, but I think im kind of stuck at the moment. Lets say that when the user switches on all the devices i.e. the motor, PC etc. At that time the motor would be at 0 degrees. Now, when the user puts in an agnle, lets say 25.00 degrees, then the motor moves, but at that time I also need for the command "01OC" to be sent automatically. what this command does is interigate the PM341 device (which is linked to the motor) and report back with the position of the motor that I am moving. i.e. during the time when the motor is moving from 0 degrees to 25 degrees I am constantly sending this "01OC" command to check its positions. so the user can see the angle on the screen increasing from 0 to 25. when now the angle goes to 25 degrees I need to stop sending this comman, but again, only when the users Desired angle is the same as the actual angle comming from the PM341 device. I tried making a FOR loop for this purpose by checking if the users desired angle and the actual angle is NOT EQUAL to zero, and if its not true than a boolean TRUE would constantly be sent to another CASE STRUCTURE where this "01OC" command is send from. But everytime I am trying to linke this I cant because it keeps giving me a message saying that "These wires form a cycle, making two parts of the diagram interdependent, so each must wait for an input from the other and neither can execute.". I understand what its trying to say, so now I thought of using shift registers instead, i.e. by sending the actual angle comming from the PM341 device to the shift register and then link the other end to the For loop, as shown. In this case it does not give me a error message, but it doesnt work the way I want it to. i.e. when I type in an angle I do get the same angle but the commands keeps being sent. Thankyou.
  9. Sorry again, but inside the ZIP folder that is posted above it doesn't seem to contain the instructions that you referred to. Sorry to be such a pain. thnx in advanced.
  10. Sorry Wmassey, you referred to a ZIP file for instructions, but the uploaded file is the Vi file only. Is this what you meant?
  11. up to now I have been trying to compile and write the report, sorry for not informing about the situation around this labview program that i was given a troumendus help from this forum (specially Wmassey). anyway, i am back for some last bits and bobs. I have been trying to store a value that I get from the hardware i.e. the angle. So, when I read an angle from the serial port (lets say 234.57 degrees) i want the labview to remember this value and store it somewhere (like a memory or something) and then close the LV aplication (or even shut down the computer) and when I open the aplication again i.e. the LV program then this value of the angle i.e. 234.57 will still be there, and now when I run the program and read the second value of the angle through the serial i.e. 54.67 then it will just add up to the last one which was 234.57, so now the actual angle will become 234.57+54.67=289.24 degrees, and then when I close the program (or switch off the computer) then this new value is memorised. I tried looking at the shift registers which seems to act like some sort of memory, which remembers the last values but I cant get it to work the way I want to. has LV even got this capability (which I really think it does), if so can anyone show me a way around it. The program that I am using is uploaded previously in this post but since there are so many different ones that are posted then I am more then happy to upload my newest version again (I just don't want to take so much memory space by posting by programs ). Thankyou in advanced. Thankyou in advanced.
  12. Hello again, sorry for not posting this earlier, its just that I was too busy writing up my report. Below are some pictures that I took the other day on my lab, it shows the place where I am working at as well as the as well as the motor that my project is based on. I also included some pictures of my hardware that I had to built so that I could read, calculate and send back the angle to another machine for display. If you are interested I can also give a brief introduction of how the hardware is built, components that are included etc. -------------------some bad news---------------------- A few days ago I tried to run the whole project as it is supposed to work, i.e. connecting the motor to the PC via serial, connecting my hardware to the PC via serial and connecting the hardware with the motor together. Everything went smoothly up to the part where I have to read the ngle comming from my hardware to the PC. Apparantly I cannot comunicate with my hardware at the same time as I comunicate with the motor. I can controll the motor, read the messages back from the motor and everything else, but what I cannot do is read any message that comes through my hardware. I know that the hardware is correct as I cn read the messages comming from the hardware with normal basic serial read and write examples that are in the LV section. and also I can read my hardware when I swap the COM ports with the motors but I cannot read anything from my hardware when I connect both serials at the same time, and try to read from them. I am not sure if LV supports this. If I connect anything to the first serial communication where the motor is connected through then I can read and write correctly but if I connect anything to the second serial that I had done in the LV then nothing comes up. Is it the way that the LV executes the program and the second serial cannot be properly working? but then again when I check both ports through the PORTMON prgram I can see that COM 2 is properly initialized depending on the parameters I am inputing in LV program for serial, or is it to the way that I programmed it, i.e. i didnt include a write VISA on the second serial because all im trying to do is read through that serial. Have you got two devices that you could possibly connect to both of the serials at the same time and talk to them or more importently to try and just read anything through them, so that you cna see exacly what is happening, because for the past two days I tried everything and I cannot get this working. ---------------- end of problem------------------------------------------------------ thanks WMassey and I hope you can help me with these last problems so that I can patch up and finish this project. Download File:post-4068-1141408917.zip
  13. ou I am very sorry to have forgotten about this, I have actually implemented the string terminator character after each message. I am sending a "Line feed" before every message and terminating it with a carrige return (PC's Enter key) character after every message. Im sure this would make things much simpler. I have made some changes to the program you have given me, would tha be the final solution to what I need. Sorry about this. Download File:post-4068-1141006909.vi
  14. Dear Wmassey I have managed to put together the "probably final" program that I am using in LV, and I have attached it at the end. I know that its not even 5 % to what you have shown me but this at least I can "FULLY" explain on my report (which is required) hence I know how it "FULLY WORKS". The reason why I am not using your software is ONLY because I need to explain all of that on my report i.e. what each part of it does and how it fully works, where at this stage I am not capable of doing, as that program really is in a COMPLETELY different level of knowledge to where I am at the moment. When I first started to ask for help in this forum it was my second day that I had ever touched LV, actually I never even heard of such program untill my supervisor mentioned it, as my first intentions were to use the "STONE AGE Hyper Terminal" by manualy entering the commands, but then LV was introduced to me. Please dont take this the wrong way by thinking that you spent all that time helping me and at the end it was rubish, as I really REALLY couldn't have done this without your help. Untill now I managed to understand LV to its basics capabilities. I know I could have probably done and understand much more than now but probably I am not as bright and clever as some other people might be. So far I only used the While loops and Case structures as these are the only things that I feel confortable working with at the moment. Now I at least learned how to built and use SubVI's that you had done, as well as the main concept of how the data flows in LV. I WOULD LIKE TO REALLY APOLOGISE IF I HAD LET YOU DOWN SO FAR IN ANY WAY, because despite your endless efforts on trying to help me understand as well as trying to help me with this project I only managed to go this far. But just to let you know that it does not have to be an advanced User Interface (which would be through LV), as this language was never taught in the University, and they dont axpect a professionally built LV program. My self I am studying Electronic Engineering and I'm on my Final year. I can surely say that anything to do with electronics i.e. Microprocessors, Microcontrollers etc I am confident working with i.e. programming them etc, I will later this week post some images of what I have been working so far and the hardware in which I have built. The software that I have a high level of knowledge is the Assembly Language, which is used only on electronics for Programming Chips, which would normally be via EPROMS or Non-voletile RAMs. The reason that I posted this last section is just to show that I really am not someone who is dumb on everything, because I am not really feeling confortable on always asking for your help as I am always taking a lot of time from your own work. But as this time I have hit the rock bottom with LV I had no other choice, So I hope you wont be to angry with me. If its ok by you I have probably the last questions below that I might be asking about this project . 1) I tried implementing that "jug" command i.e. the CV command by using the toggle switch, but It keeps sending the "ST" command all the time when the switch is not pressed and the "CV" command everytime when the switch is pressed. What I need is something that when I press it it will only send the "CV" command once and When I release it, it will only send the "st" command once, so that the user can go back and use the "MR" as well as other features afterwards. I have ilustrated in the picture below about this matter. The reason I know this is that I am also running the PortMon program at home, where I am contstantly monitoring the Serial port and now when I run the LV program I can see that it constantly sends the commands. I also know that why this is happening, becuase I dont think I can use Case structure or putting this part of the software inside the While loop because it keeps constantly execute theses commands i.e. when the Case Structure is true, it will constantly send CV command and when Case structure is False i.e. when the switch is off it will constantly send the "ST" command. 2) I am reading two serial ports i.e. one serial port is reading and writing the messages to the McLennan device and the other serial port is ONLY reading from my microcontroller. What I want is when I read from my Microcontroller (which will always be a Five digit number and onw decimal point i.e. I will only read in the form of "256.78" this is the type of data tha I will always be reading from my Microcontroller) I want to display this number fully in One small box, i.e. same box size as the one "Number of Steps Going To The Motor" which can be seen on my front pannel. I am reading quite fast, i.e. at a rate of 10 miliseconds,so I just need to keep displaying the new number that comes through ( this would be when the motor is in motion ) and when the motor stops the last value that is read by the serial port should be held at least untill the new number comes in to replace the old one, and so on. This problem however is for both serial ports, but the solution I would assume would be the same, as all I am trieing to do is diplay. 3) And finally I am trieing to make a Slideing Bar (which is shown in the front pannel) and instead of connecting that to the values that the user inputs I would like to connect that to the numbers i.e. the values that are comming through the serial port i.e. if I recieve 34.56 through the serial port of the Microcontroller then the slide bar should move to the 34.56 place. Dont worrie about the limits of the slide bar as I can easily change them on my side. The reason I am not able to do this is that anything comming out of the serial seems to be a String, whereas the slide bar accepts a different ype of value, and I am having trouble converting that simple thing. If it takes too long to implement your idea on my program than just a prototype of what you would do would be great. thnx again. Download File:post-4068-1140986484.zip
  15. Sorry if I misled you all, but the limit switches are allready set up through the MClennan Controller and they work fine, when the motor goes to one of the ends it automatically stops. this is something that is covered with my hardware, so its not fully dependet just from the computer. Appart from that I have also included manual controll switches which move the motor manually to the left or right. but I was also thinking that because I have the limit switches in the hardware there are no indicators on when the limits are activated but instead it just stops the motor straight away, no matter what the motor was doing, as my hardware at that point completely cuts the power to the motor, and due to the weight ( they are at least 500 kg each) the motor stops completely, this method has also been adviced by my supervisor. But now I was thinking to stop the motor via the software i.e. through the user interface as when the limit switch is activated the motor moves for another 3 mm before my hardware kicks in to cut the power. So now i was thinking to stop the motor via user interface before the it reaches the 3 mm i.e. when the limit switch is activated then straight away i wanted to send the stop command without having to let my hardware take care of it, and if that fails than I have my hardware as the back up or as the finall emergancy stop. ou, and as for body harm there is no worries as the motors that i am controlling are actually in totally different room and a pass is required to enter that room, as there are other very delicate devices in the laboratory, and everytime i try to controll the motor I have to be on the other room but i can only see the motor via a see through glass when i move it. How do you make these requests and how do you get the status of the limit switches. i.e. what command did you use for this thanx for your concern
  16. Hi there again, I wanted to ask if one of the below examples are any good for parallel connection. During my search I found out that VISA can also be used for parallel connection but when that is used the pins 11 and 12 need to be grounded externally (where in my case they can easily be done). There was another idea where the "in port" can also be used, but this time the registers address for the parallel port needs to be given (where in my case its 0378). All that I need to do is use the parallel port as input, not as output as there is no need for me to writte anything out to the parallel port, but instead I need to check for three pins only i.e. pins 2, 3 and 4. and nothing else, infact all the other pins are empty, I only have a ground on pin 18 of my parallel port and thats it, I now need to read from pins 2, 3 and 4. These pins will usually be HIGH (5 V) but only when something happens to the external hardware depending on the condition one of the pins i.e. either pin 2, 3 or 4 will become logic LOW i.e. (0 V). When ever any of these pins of the parallel port is trigered low I need to send a function through the serial port (Which is allready set up). i.e. when pin 2, 3 or 4 of the parallel port becomes "0 V" or logic LOW then i need to send the command "01#st", as well as I just need to have three LED on the front pannel for three of these pins, depending on which pin is trigered LOW then that LED should light up, indicating of this change and automatically send the mentioned command. I really tried my best searching about this but looks like once again I need your help. If its possible to have something as simple as possible, i.e. there is no need for me to do any of the error checking or anything like that but only the above task. anthing would be approciated, thenx.
  17. Thnx for the reply. I tried to add this second serial port in but Im not too sure If its going to actually work. I havent got a chance to try it till next week on the lab, as its closed for the half term at the University, but I just dont feel completely right, I mean I'm not too sure if I actually did it the right way or not. I took a print screen of what I have changed as well as the updated program. I have also Copied the "Yak at McLennan.vi" and renamed it "Yak at McLennan Encoder.vi" and I placed it under the same SubVI's folder. I'm not sure if that is enough, or if I need to do something too it. Thanx again. Download File:post-4068-1140740477.zip
  18. You can bet on that, Now as I am starting to get a good idea around LV I am also starting to enjoy programming with LV. Thnx again for everything. I also totally agree with Wmassey, thatr unless the effort has put in there is no result and no way I would be able to learn LV. Believe me that I am trying day in and day out to understand how the LV works but I dont agree with my tutor at University saying that it is a very easy programm to work with. I really am finding the opposite. Nevertheless I managed to spot the problem that I had with the "move relative" part, where it was only giving me the negative answer ( I ilustrated this below). The step by step procedure that you told me was very helpfull (even though it tokk me aound 1hour and 15 minute ). Would it be ok if I can ask for some more assistance i.e. to make some changes to the existing program. I DONT WANT FOR YOU OR ANYONE TO DO THE PROGRAM but just as you did earlier with the steps of finding that problem, and this way I can actually understand things better, and it will really be a big push for me towards learning and being more familiar about the LV program itself. Once again, I really dont know how to repay you guys, specially "Wmassey", orko and the rest as you really gave me the best help there could ever be. My self I never used any forums before as I really never believed they could be much of help, but that is certenly going to change from now on, and I'll try and lend my experience to the others too. :worship: Millions of thanks again.
  19. Well, after this, I really am left speachless, Its really very very very close to what I needed exacly. There aren't any words that I can put it on how I feel but nevertheless I would realy really like to thank Warren (Wmassey) for actualy spending so much time and actually getting it to work as well as other members for putting their thoughts and actually helping me out big time. :worship: When I checked at the program, it was so professionally looking to me that I dont seem to have the slightest clue on how to edit things on it to 100% the way that I need it. The program seems to be going loops within loops and I totally lost it. -------------------MORE IMPORTANT--------------------------------------------------------------------------------------------------------- one thing that I needed to add is the second RS232. this second RS232 which comes out of my Microcontroller goes to COM2 at the back of the PC. Through here I will recieve the angle at which the (Stepping Motor X only) is recieved. Now, I wanted to have a reading of this angle and display it on the main window under the "RUN" tab which Wmassey has made. below I have ilustrated the place where this should be displayed. This is really easy to built, as it does not require any of the fancy "line feed' or "carrige return" because this Microcontroller hardware is built by me hence none of that is required. I am able to talk to my hardware easly by just using the example aploaded below, BUT I just dont have the slightest clue on how to put this on the main program that Wmassey provided me with. "" I'm really dum arent I"" . Baud rate: 2400 Data bits: 8 No Handshaking required Stop bit: 1 ------------------------------------------------------------------------------------------------------------------------------------------------- ----------------LESS IMPORTANT BUT WOULD INCREASE MY MARKS-------------------------------------------------------------------- The second and hopefylly the last thing that I needed to connect is a Parallel port. On this parallel port I am only using the first three pins. The first pin and the third pin is the left and the right limit of the X motor respectively (which moves in "mm") and the second pin is the ORIGIN of the stepping motor Y. Normally these pins are high i.e. 5 V, as soon as the left or the right limit are touched by the motor then the pins go LOW i.e. 0 V, however as soon as that happens the motor should outomatically stop, and the way to do that is by sending a command "01ST", this will stops the motor. Same goes with the ORIGIN i.e. pin 2, as soon as that goes low the "Y stepping motor should stop via the same command but now 02ST, as that corresponds to the Y motor". When it hits the origine the "Current Position" place which is located under the "RUN" tab would be zero, and then the motor is moved from that position, so the user knows exacly where the "Y stepping motor" is positioned ------------------------------------------------------------------------------------------------------------------------------------------------- One thing that I actually realised while testing is that the "Relative movement for both motors "X and Y" were not able to accept any positive values i.e. when i enter 5.23 for the X motor, it kept sending 01MR-xxxx where "xxxx" would be the steps. i.e. no matter what I entered it kept converting it to a negative value and then sending that through, whereas the motor actually goes one way when the positive value is entered and the opposite way for the negative value. Sorry if I wasent clear about this at the beginning. Once again, Many Many Many thanks to everyone especially Warren (Wmassey), as well as orko. B.T.W. I see there are some doubts going around with the user called "Switesh". He is my partner for this project, at the beginning when i used this forum for the first time i also informed him to use it, but then he was still working on the Hardware side of the project i.e. the Microcontroller board, so now he wants to help me out on LV side. Sorry if this offends or scares anyone , and its only the two of us involved in this project, no one else. I will post the same program which "switesh" posted earlier on, this was as far as I managed to go when trying to controll both motors. But it shows rouphly of what I wanted to do. the parallel port is not implemented on this LV program because I havent even started doing that side yet. ONCE AGAIN, I REALLY WANT TO THANK EVERYONE FOR THEIR HELP ON THIS. Thnx Wmassey and orko too. Download File:post-4068-1140552344.vi
  20. Thanx for that "orko" but for some reason when I connect your program with the WMassey program that gave me it doesn't work properly. Everytime I run it it keeps sending the command over and over again even though I dont press the "Send" button, but when I press the "send" button it sends several commands straight away, where I only need it to send 1 command per click. I monitored the output that is going to the serial through PortMon, and the attachement is below together with the attachement of the front panel of the LV program that I was running when I captured the traffic with PotMon. Below is also the program that I tried modifying. and yea, its exacly what I needed. Many thnx for the help. Download File:post-4068-1140397712.vi
  21. Ok, there should be two buttons that the user can click depending which motor will be used. For example, button 1 can be called "Initiliazing Motor X" whereas button 2 can be called "initiliazing Motor Y" dependging on which button is pressed a certain commands are sent to the motor automatically (Please read the previous page where the 2st point as well as 2nd point are explained that how these buttons should work and what commands are sent when these buttons are preseed). normally when one of these buttons is pressed a number of commands are sent automatically, but also in the front pannel of the LV there should also be a space where the user can enter the angle (for motor Y) or the length in "mm" for motor (X). Now, when the user enters the angle or the length then yeah, its true that there is some mathematics behind it, but all this mathematics does is turn the length or the angle at which the user has entered into the number of steps, so that its ready to go to the motor, but the only way that the motor will understand is when the whole command is sent i.e. 01MR2959 or 02MR2358. The reason the numbers are in red is that this number represents steps of whatever angle or length the user has entered whereas the part "01MR" and 02MR" are there always constant depending which motor the user was using. So when the user enters the length or the angle it is then converted into steps, once this number is converted into steps the whole command "01MR2342" or "02MR3445" (depending which motor) should be sent, otherwise the motor would not understand that it should move by "2342" or "3445", hence the command "01MR or 02MR" should always be before the number of steps is sent through. So, the final result should be "01MR2342 or 02MR3445", where as the part "01MR or 02MR" should not have been entered by the user. This part should always be there as a constant behind the "SEND" button so that when the user enters the value and presses "SEND" the this value should undergo under these mathematical changes so that this value is turned into the number of steps and the at the end this final number should be joint together with the command "01MR or 02MR" and then finally the whole lot "01MRNo.odSteps or 02MRNo.odSteps " (depending which motor we are talking with) should finnally be sent all together through the serial. So this is the part which i dont know how to do. Talking to the motor is allready set up. The program that I am using so far has been uploaded on the previous page, so please see if you can take sometime and help me out a liitle. I really approciate your help, thanks.
  22. I managed to do the 1st point above somehow, even through its not exacly what i needed, but I really am scared about the third point, I have no idea how to even start with that. Could anyone please help me out a little. thats the hardest part that I am facing so far. Thnx in advanced.
  23. Its great, I finally got it moving. the problem was that it was duplicating the comand that i was sending i.e. when i send "01RS" the actuall characters that were being sent were "0101RS" and hence i coudnt see anything. this was due to the "Device address" that you built on the front pannell. I had no idea that when selecting the Device address 1 the "01" part of the command was allready there to be sent, and when selecting the Device address to 2 the part of the command "02" was ready to be sent, and when I was sending the whole command "01RS" or "02RS" I ws actually sending "0101rs" or "0202RS". Anyway it works perfectly now. Thankyou :worship: . I know it was my fault as I should have known how to use that program from the beggining . What I am about to ask for might be too much from you guys (specially from "WMassey" as he was the one helping me the most), but I was given this project from out of the blue, I had never done or even heard of the programm called LabView before, I only have from today 32 days remaining and this counts for 20% of my whole year of the university. I am finding it extremely difficult to understand this software even though i admit its easier then most of the others like "C, or C++ etc" as this software is more sort of graphicall use. I my self am an Electronic engineer, I am good with electronics and "assembly" programming, which is a programminglanguage for electronic chips like Microcontrollers etc. but i have absolutely no idea on LabView. I would be most greatfully if anyone (including "WMassey") could spend a little time helping me out, as i am very very short of time especially when i have a mounten of other reports and coursework to do. Thankyou form for everything that anyone can offer especially i would like to thank "WMassey" for his time with me for this past week, as he actually wrote a fully functunal program for me, and helped me out to the fullest. Top Man, thanx. This project however wasnt going to be as easy as this for me, to complecate matters more, i will eaplain the rest below: 1) I need to make the user Interface part i.e. the front pannel so that when the user clicks a button (lets call it "Ceck Status "X"" for motor X and "Check Status "Y"" for motor Y) the message "01OS" will will be sent to the motor "X" and message "02OS" will be sent to the motor "Y" when those buttoms are clicked. On the reply we would recieve the message "01#0000000000" and "02#0000000000" respectivelly. If however one of the bytes in red happen to be high i.e."1" then the command "01RS" or "02RS" (depending which motor it is "X" or "Y") would be sent automaticakky, and that would reset the motors back to default, because if any of those bytes are high then this means that the motors are busy or there is some sort of an error in them, hence cannot be moved. 2) After the first point is done the second part of the header should then be sent automatically, i.e. the command "01SB300" should be sent first, then "01SV6000" for motor X, and "02SB300" should be sent first then "02SV6000" for motor Y (depending which button was clicked by the user at the beginning. If everything has gone smoothly on the above points, there should be a "green light" for each motors i.e. for X and Y and if this initialization wasn't done properly there should be a "red light" for both motors, indicating that something has gone wrong depending which motor was used. 3) The first and the second part of the points above were to make the motor ready i.e. to set them up. Now, if everything went OK then the command "01MRxxxx" or "02MRxxxx" would be sent at the end depending which motor the user is using. The reason why I marked the "x" part in red is: a) The motor "X" wors in steps, hence its a stepping motor. and for this, the user would only have to enter a length in "mm" and this number would have to automatically convert in steps and then that answer should replace the red "x" shown above. This particular motor has 800 "steps" per "mm". E.G. When the user enters 5.00 (which means 5.00 mm) the value "4000" should replace the red "x" above. or when the user enters 1.26 (which means 1 mm) the value "1008" should replace the red "x" above, i.e. this is done by doing "1.26 * 800". This can however go up to 2 meters at maximum, and no more. b) The motor "Y" works in the similar way as motor "X" works but instead the user here enters an angle rather than a length in "mm". And here this motor has 300 "steps" per "degree". E.G. When the user enters 25.30 (which means 25.30 degrees) the value "7590" should replace the red "x" above. or when the user enters 27.00 (which means 27.00 degrees) the value "8100" should replace the red "x" above. This can however go up to 360.00 degrees at maximum, and no more. 4) When the user enters the data at the end the red "x" on the command should now have numbers in i.e. lets say that the user enteres 2 "mm" for the "X" motor, then the last command "01MRxxxx" should be "01MR1600" and this should automatically be sent at the very end. and this would complete the whole lot. Below is an attachement of the program that communicates with the hardware called PM341, which WMassey built it for me. This program only works when i sent the actuall commands i.e. when I select device address 1 and send the command "RS" I recieve a reply "01#OK" because I am actually sending "01RS" (which means I am talking to the "X" motor) and when I select device address 2 and send the same command, then I recieve "02#OK" (which means that I am taslking to the "Y" motor). Download File:post-4068-1140125689.vi
  24. hi guys again, its just that I have been so busy doing the report lately i havent been able to respond back. WMassey ---> You were correct about the nature of the device, and thats the actuall Manual that i use for this device. One thing that I coudn't come accross in that manual is the all the replies being terminated with a line feed, i just coudnt find exacly what type of termination character it uses or but I wouldnt be surprised if it doesnt use one. Oh, and i do make sure not to make the simple mistakes like, leaving the Hyperterminal on while using LV and vise versa. One thing that is bothering me are these reply terminations, and the transmitting part. I just dont seem to know if I need to send something else before I actually transmit my commands, because i know for sure that i cannot trasmit the comand as the motor is not moving at all, even though i dont recieve anything the transmitting part isnt working either. e.g. when i sent "MR10" to the device it should move the stepping motor straight away and this does not happen with LV, whereas when i use the same command with Hyperterminal it works perfectly (even though it does not echo back the command that i am sending, but it does get the motor moving and i do recieve the messages back stating its status i.e. ussually i recieve "01#OK" if i send the command "01RS").
  25. Sorry for the late reply but the only place I can test the program is at University. When I tested that modified program for some reason it didnt do anything at all, even though as you said that i can just send the comands as usual it didnt pick up anything and i didnt recieve anything neither. The LV program never terminated neither. Looks like it was waiting for 250 characters on the buffor or something. One thing that i totally forgot to test was the portmon program to check that what am i actually sending through the hyperterminal and what am I sending through the LV. apart from that i have no idea. Please let me know if you have any other tricks that might solve this matter as I onyl have 1 month to go. thnx again
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.