Recent

Author Topic: Error: Wrong number of parameters specified for call to "Assign"  (Read 2753 times)

rvk

  • Hero Member
  • *****
  • Posts: 6711
Re: Error: Wrong number of parameters specified for call to "Assign"
« Reply #30 on: September 23, 2024, 07:12:23 pm »
It also makes lots of assumptions about the speed that the port is set to by default, the state of (in particular) DTR and so on.
Connecting via usb would be standard and there would be no need for speed etc. But the arduino should also be programmed to receive it correctly.

@Aruna you also might want to show the other side (arduino code) because in the given video there is only character per character read (and not even from usb). And you might give some more information about how you connect both sides.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8379
Re: Error: Wrong number of parameters specified for call to "Assign"
« Reply #31 on: September 23, 2024, 07:41:48 pm »
It also makes lots of assumptions about the speed that the port is set to by default, the state of (in particular) DTR and so on.
Connecting via usb would be standard and there would be no need for speed etc. But the arduino should also be programmed to receive it correctly.

That's not the point I'm making. My point is that on Windows I /think/ that a serial port starts off in a known state and is restored to that state by the OS, while in unix- at least Linux but I believe others as well- the speed and signal state are /not/ normally changed by the OS... that's where the setserial command comes into it, at least for some port types.

And the convention that the OS does not meddle with the speed ties in with the convention that the serial port is /not/ opened exclusively, which goes back to how a getty works: it monitors a serial line and expects some form of user identification, after which it fires up either the login program (to read and validate a password) or e.g. a handler for an incoming fax. But in either case it stays running in the background with a handle for the serial line, and does not expect anything to permanently mess that up by e.g. changing the speed.

So a standalone program cannot ever assume that the speed and modem control lines are in a sane state: if dictated by its function, it has to set them explicitly.

And that's also why SerOpen() in serial.pp doesn't attempt to get an exclusive lock on the port it's opening. However in retrospect I regret that choice, and would prefer to e.g. have an SerOpenLocked:Boolean=true global or possibly an extra parameter to SerOpen(). But I'm not going to try adding it because (a) I don't relish getting involved with Git and (b) I'm no longer in a position to test thoroughly on a relatively-recent Windows and on a BSD-style unix.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Aruna

  • Hero Member
  • *****
  • Posts: 627
Re: Error: Wrong number of parameters specified for call to "Assign"
« Reply #32 on: September 23, 2024, 08:07:58 pm »
@Aruna you also might want to show the other side (arduino code) because in the given video there is only character per character read (and not even from usb). And you might give some more information about how you connect both sides.
Hi @rvk thank you for making me go over this again. I just found out what the problem is and your gonna have some serious fun with it when I disclose after I rustle up some grub because I am famished. Will be back in a bit. Your never going to believe what is happening with my nano :-)

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1362
Re: Error: Wrong number of parameters specified for call to "Assign"
« Reply #33 on: September 24, 2024, 06:25:22 am »
Quote
So your pissed, so what else is new? Does not @Joanna  upset and piss your off much more? ( What is a friend for ?) and flattery I save for the fairer sex like our Joanna. I called it the way I saw it. That code was something else, but not what I was looking for is all.
Wow.. ok can anyone guess why I keep suggesting that people who don’t know pascal should not be allowed to post in the support part of these  forums?  >:D
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

 

TinyPortal © 2005-2018